Need help w. Applet Image.

S

Steve R. Burrus

I need some help/assistance from someone re. how to see an image of
something in an applet! It is a simple A.W.T. applet that uses the twin
Java methods of "getImage()" and "drawImage()". when I try to run it I
get an "UnsupportedClassException". Can someone please help me? Here is
the error dump from the Java Console.

Java(TM) Plug-in: Version 1.4.2_04
Using JRE version 1.4.2_04 Java HotSpot(TM) Client VM
User home directory = C:\Documents and Settings\Administrator

Proxy Configuration: Browser Proxy Configuration





----------------------------------------------------
c: clear console window
f: finalize objects on finalization queue
g: garbage collect
h: display this help message
l: dump classloader list
m: print memory usage
o: trigger logging
p: reload proxy configuration
q: hide console
r: reload policy configuration
s: dump system properties
t: dump thread list
v: dump thread stack
x: clear classloader cache
0-5: set trace level to <n>
----------------------------------------------------
java.lang.UnsupportedClassVersionError: My_Image (Unsupported
major.minor version 49.0)

at java.lang.ClassLoader.defineClass0(Native Method)

at java.lang.ClassLoader.defineClass(Unknown Source)

at java.security.SecureClassLoader.defineClass(Unknown Source)

at sun.applet.AppletClassLoader.findClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)

at sun.applet.AppletClassLoader.loadClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)

at sun.applet.AppletClassLoader.loadCode(Unknown Source)

at sun.applet.AppletPanel.createApplet(Unknown Source)

at sun.plugin.AppletViewer.createApplet(Unknown Source)

at sun.applet.AppletPanel.runLoader(Unknown Source)

at sun.applet.AppletPanel.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)
 
S

Steve R. Burrus

I think we would need to see the code to help you.

Okay here is my code for the image applet that I seem to need some
extensive help with!!!
import java.awt.*;
import java.applet.*;

public class My_Image extends Applet {
Image im;


public void init(){

im = getImage(* getClass().getResource("lg2.jpeg"));
}

public void paint(Graphics g){
g.drawImage(im, 15, 17, 350, 434, this);
}

}"<<

* means that I first tried the method "getCodeBase()", but that seemed
to fail!!!
 
R

Ryan Stewart

[...]
java.lang.UnsupportedClassVersionError: My_Image (Unsupported major.minor
version 49.0)

[...]
It doesn't have anything to do with an image. You're trying to run code compiled
for 1.5 in 1.4.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top