Applet Viewer - Show Status Method Not Working
Apr 6, 2014
import javax.swing.*;
import java.awt.*;
import java.net.*;
import java.io.*;
public class App extends JApplet{
public void init(){
showStatus("applet");
}
}
This code does nothing to my statusbar.
I use applet viewer for my applet.
View Replies
ADVERTISEMENT
Jun 22, 2014
I have an applet which I want to embed into HTML. In applet viewer in Eclipse IDE the view is this(see pict01), and when I access my index.php on local server I get this view(see pict02). I don't know what I am doing wrong. I checked it with Firefox, IE and chrome. No changes. Here is source code:
import java.util.*;
import java.io.*;
import javax.swing.*;
import java.awt.*;
import java.applet.*;
import java.net.URL;
public class WCURL extends JApplet {
//static final int WIDTH = 8;
//static final int HEIGHT = 12;
[Code] ......
I have these files in my local servers folder where I am trying to access it from(see pict03).
View Replies
View Related
Aug 3, 2014
The PNG Image is already in the src package thingie...
It's a 400 * 258 image...
Java Code: package frame;
import java.awt.*;
import java.applet.Applet;
import java.awt.event.*;
public class Temperature_Convert extends Applet
implements AdjustmentListener {
private Image temp;
private Scrollbar bar;
[code]....
View Replies
View Related
Jan 17, 2015
I'm working on an applet for my class. I decided to use AWT even though it's really old.
I'm having trouble with the labels on my program. They don't show up until I click another tab in the browser and then go back to it each time after I click on a button. I tried to use repaint() but it doesn't seem to work. What can I do?
import java.awt.*;
import java.applet.*;
import java.awt.event.*;
import java.awt.event.ActionListener;
import java.awt.color.*;
public class FinalTwo extends Applet implements ActionListener{
Button b1;
Button b2;
[Code]...
View Replies
View Related
May 18, 2014
I need to make a scanner (that has a built in ocr) output some content to a browser. I haven't gotten to the browser yet, but the code works when I run it as an application. With the scanner, I received Java code that makes the scanner take a picture, then read from it and output it back to the console. I added a few lines to make it an applet:
Java Code:
import gx.*;
import pr.*;
import java.applet.*;
public class DocScan extends Applet {
/**
*
*/
private static final long serialVersionUID = 1L;
[Code] .....
I am using Eclipse as an IDE. Right now my goal is to simply make the scanner "flash". I know that the output is to the console and I will not see anything from it in an applet, but it should still flash.
When I run this code as an application, it works. The scanner takes a picture and then it outputs what it has read to the console.
When I run this code as an Applet, the applet starts and does nothing. It just stays there with no errors of any kind (at least that's what Eclipse is showing me).
I read that I should allow the applet access, so I edited:
Java Code:
c:program filesjavajre8libsecurityjava.policy mh_sh_highlight_all('java');
And added this at the end:
Java Code:
grant {
permission java.security.AllPermission;
}; mh_sh_highlight_all('java');
Which should allow applets full access. However, there is no change - the applet still launches and does nothing. Why is the code not working when I run it as an applet?
View Replies
View Related
May 9, 2015
I have to implement a face that smiles and frowns. I figured the easiest way to do this was to use JButtons. I also can't close the applet without hitting "end program". I was given a bit of code and had to add onto it. Here's what I have so far.
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.awt.BorderLayout;
import java.awt.Graphics;
import java.awt.Color;
import javax.swing.*;
public class AnimationFace extends JFrame {
public static final int WINDOW_WIDTH = 400;
public static final int WINDOW_HEIGHT = 400;
[Code] .....
It's 90% done but once I changed the face from smile to frown, it lost an eyeball.
View Replies
View Related
Aug 31, 2014
I have written a java applet. Few months before It was working all fine but my client has some other requirements now and I have to edit it. I am getting two problems:
1. I could not execute it on my local computer as it always gives "your security settings have blocked a local application from running". I have edited the settings from Control Panel but it is then started giving permission error on including permission in manifest file it started giving trusted library error and still it is not resolved.
2. Can I know how to work with third party library with applets. I have imported the library and uses its few classes but when I tried to load applet it always give no class definition found error. I have some ways mentioned online like use comma separated names for all the jars but no luck so far.
View Replies
View Related
May 5, 2014
The JSP page is opening but the problem is if l click on the ADD or EDIT button l receive the 405 error Iam using MySQL and glassfish server
web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.1" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd">
[Code].....
View Replies
View Related
Jun 27, 2014
I am starting a project of a little game for my brother and I wanted to know whether a few things were possible using Java (I know the basics and am currently learning more, but I have about a year to complete this so I have time to learn what is needed).What I need to be able to do:Be able to view a PDF as well as zoom in and pan around itBe able to enter/edit text in said PDF fileBe able to hide some of the text in this PDFBe able to do this on several PDFs in one program (They won't be open at the same time)
Is it possible to do this in Java? If so, how? (As in, what things would I need to learn or what would I need to complete it)If it makes my question easier, what it will be is a London Underground Tube Map (Which is a PDF file)where some station names disappear and the player has to guess which station(s) are missing.
View Replies
View Related
Apr 8, 2014
I need to create an applet that displays a grid of command buttons which I have done. I then need to create a new class that draws a silly picture of an alien, which I have also done. Where I am completely stuck and confused, is that I do not know how to get the drawing into the applet. My code is below. I really do not fully understand why this is not working or how to get it working.
import java.applet.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class MartianGame extends JApplet implements ActionListener {
DrawMartian aMartian = new DrawMartian();
DrawJupiterian aJupiterian = new DrawJupiterian();
[Code] .....
View Replies
View Related
Apr 30, 2014
I'm getting a Base64 encoded String of raw PDF data from a web service. I have to use this data display the PDF in a PDF viewer (I happen to be using the included 'ThinkFree PDF Viewer' since I'm working on an Android application, but the Android forum doesn't seem to get much traffic, so lets generalize and say any PDF viewer will do).
My code:
File file;
FileOutputStream outputStream;
public void createFile() {
try {
File path = new File(getFilesDir(), "PDFs");
if (!path.exists()) {
path.mkdirs();
[code]....
The error: Error opening file. It does not exist or cannot be read.
View Replies
View Related
Sep 30, 2014
I have been trying to get this code to work but in jGrasp it give the no main method, applet, or IMDlet. The assignment states: Design a class Message that models an e-mail message. A message has a recipient, a sender, and a message text. Support the following methods:
-A constructor that takes the sender and recipient
-A method append that appends a line of text to the message body a method toString that makes the message into one long string like this:
"From:Harry Morgan
To: Rudolf Reindeer. . ."
Write a program that uses this class to make a message and print it. package emailmodel;
import java.util.Scanner;
public class Message
{
private String senderemail;
private String receiveremail;
[code]....
View Replies
View Related
Oct 21, 2011
i am trying to create an applet with drop-down lists. When I compile the program the following error message appears '. . .is not abstract and doesn't override abstract method action Performed. . . Here is my code . . .
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
public class DavidApplet extends Applet implements ActionListener //class header {
Label fName=new Label("First Name");
[Code] .....
View Replies
View Related
Sep 14, 2014
I have two questions.
1 - I don't understand why I'm getting an empty stack error when calling the removecard method in my Table class line 13?
2 - I am trying to use a constructor to populate my deck of cards instead of a method when creating my theDeck object in my Table class line 11 but I get the following error:
java.lang.StackOverflowError
at java.util.Vector.<init>(Unknown Source)
at java.util.Vector.<init>(Unknown Source)
at java.util.Stack.<init>(Unknown Source)
at Deck.<init>(Deck.java:7)
at Deck.<init>(Deck.java:34)
public class Card {
String enseigne;
int valeur;
[Code]....
View Replies
View Related
Oct 30, 2014
I have two comboBoxes - one in main and another in my 'windows' class. The code below is in main and references the comboBox in main but I need to use the comboBoxEnv out of my 'windows' class. How can I do that so it says ComboBoxEnv rather than comboBox?
JMenuItem menuExport = new JMenuItem("Export");
menuExport.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
if(comboBox.getSelectedItem() == null){
[Code] ....
I've gotten access to it by changing my code and making a method of it but I'm not sure of what I do now
exportImport.comboBoxEnv();
View Replies
View Related
Feb 8, 2015
I made a program to see how JTextField works. However,the contents inside the actionPerformed method of class FieldListener do not get executed when I press enter.
import java.awt.event.*;
import java.awt.*;
import javax.swing.*;
public class Checker
{
public static boolean check;
public static JFrame imgframe;
[code]....
View Replies
View Related
Mar 15, 2014
I am trying to get resultset into a string and then use split method to store it in an array but it is not working. i tried to work it seperately as java program but it throws exception "could not find or load main class java."
String ar = "This.is.a.split.method";
String[] temp = ar.split(".");
for(int i=0;i<temp.length;i++){
System.out.println(temp[i]);
}
View Replies
View Related
May 5, 2015
***** start code ***
public class AddArray {
public static void main(String[] args) {
int sum = 0;
sum = addArray(myarray);
System.out.println(" hello");
System.out.println("This program will create an array then pass the array to an method to be totaled");
int myarray[] = new int [6];
[Code] ....
View Replies
View Related
Apr 30, 2015
I have the following code.
class A {
List<StringBuilder> list;
public void output(List<StringBuilder> objectToOutput){
try(BufferedWriter bw = new BufferedWriter(new FileWriter("temp.txt"))){
for(StringBuilder row:objectToOutput) bw.write(row.toString());
}catch(IOException e){}
[code]....
Why don't the a's show up on the console? I put them in as part of the debugging process and now I don't understand why they don't show up in both places.
View Replies
View Related
Feb 2, 2015
I am trying to sum up the elements of an array. When I test my code the sum is always off by one. For example if I input: 20, 40,30 it gives me 89 instead of 90.
This is what I have so far:
public static void main(String[args]){
int size = kbd.nextInt();
int [] myArray = new int [size]
//user inputs the elements of array
[Code]....
View Replies
View Related
Sep 19, 2014
In my jsp page , functionality is their to change the status of the employee, so i want that if i click on activate it should change the link to the deactivate and when i click on deactivate it should change to activate. How can i do that?
View Replies
View Related
Mar 9, 2014
i am using netbeans6.7.1 version i implemented one program i.e web application ..when am excuting this one i got one error http status 500...
this is the code:
SumServlet.java
package com.sum;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
[code]....
View Replies
View Related
Mar 9, 2014
correct this error
WishSrv.java
package com.wish;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Calendar;
import javax.servlet.ServletException;
[code]...
View Replies
View Related
Mar 8, 2015
below is my code and this exception was thrown in another page so I created a new page and only imported just a single package still its throwing an exception? Any reasons why?
<%@page contentType="text/html" pageEncoding="UTF-8" %>
<%@page import="java.sql.*;" %>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<h1>Hello World!</h1>
</body>
</html>
View Replies
View Related
May 20, 2014
Reading a sequential flat file (which is working) but now I need to add code to update the status flag (setting it to ‘Y’ position(7,1)) before I close the file and not sure how without defining the fields.
try
{
tFile = getTFileName();
System.out.println("File Name: " +tFile);
ukarf = new ZFile(tFile, options);
while(!EOF) {
int bytesRead = ukarf.read(buffer);
System.out.println("Record read: " +new String(buffer,0,9,"IBM-1047"));
if(bytesRead == -1)
[code]....
View Replies
View Related
Feb 26, 2014
Below is my Servletclass code
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class MyFirstServlet extends HttpServlet {
[Code] .....
I have configured tomcat7 in my ecclipse ide...
View Replies
View Related