Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ASAP Java 2 Swing Library

Status
Not open for further replies.

KentCoon

MIS
Aug 11, 1999
10
0
0
CA
I'm doing something for work right now.<br>
<br>
I need the use of the swing library to write the applet but I can't get to it. I just installed Java version 1.2.2.<br>
<br>
Any ideas on why it's not working? Where do you think this file is stored?<br>
<br>
Thanks alot!
 
to give you a little more information here is the error message I get when I try to call JApplet:<br>
<br>
exception in thread "main" java.util.MissingResourceExcption: Can't find resource for bundle sun.applet.resouces.MsgAppletViewer, key appletpanel.badattribute.exception<br>
at java.util.ResourceBundle.getObject(ResourceBundle.java:322)<br>
at java.util.ResourceBundle.getString(ResourceBundle.java:298)<br>
at sun.applet.AppletMessageHandler.getMessage(AppletMessageHeandler.java:46)<br>
<br>
and etc...
 
KentCoon,<br>
<br>
If its not to long, please post the program.<br>
<br>
DigitalOx<br>
<br>

 
Can you set the CLASSPATH environment variable correctly?<br>

 
import java.applet.*;<br>
import java.util.*;<br>
import java.awt.*;<br>
import javax.swing.*;<br>
<br>
public class apple extends JApplet {<br>
public void paint(Graphics g) {<br>
g.drawString("Yes!", 25, 35);<br>
}<br>
}<br>
<br>
I was just testing it.<br>
It's in it's own directory. called c:/javaprogram <br>
The java itself is stored on c:/jdk1.2.2/<br>
<br>
Any ideas. Thanks for the hints!<br>
As for class path. Well I read the info and iit told me that I didn't have to set it... so it's got nothing on it... maybe I should change it.. think you could help a guy out?<br>
<br>
thanks
 
I have a bigger problem then that... I just realized. The hello world doesn't work either...<br>
<br>
it says: Exception in thread "main" java.lang.NoClassDefFoundError: HelloWorldApp/class<br>
<br>
any ideas? Help!
 
by the way I put the c:/javaprogram into path class path already.
 
Hello,<br>
<br>
You aren't trying to run it using the .class extension are you? <br>
<br>
//Correct Way<br>
java Main<br>
//Wrong Way<br>
java Main.class<br>
<br>
Java is a little weird that way - you have to specify the .java extension when compiling but not the .class when running. I get the same error you get above when I try the wrong way, so I thought I'd throw that in.<br>
Also, I don't know what OS your using but I like to just set the classpath at the dos prompt<br>
<br>
//Correct Way<br>
C:\set classpath=C:\myjava <br>
//possibly incorrect way<br>
C:\set classpath = C:\myjava<br>
I think I remember reading in the java docs not to put spaces around the equal sign. I follow the uppercase/lowercase exactly in the file path, just to be sure.<br>
<br>
Good Luck, Hope this helps<br>
DigitalOx<br>

 
Thanks alot, that fixed the Hello World problem!!<br>
I did it the Wrong way... he he he....<br>
<br>

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top