Click to See Complete Forum and Search --> : Applets and JApplets


Paddy Notemaker
02-02-2005, 10:50 PM
Dear all,

I have made an applet that I want to make into a JApplet, as I want to add a menu and scroll bars. The program I have made is an image changing cataloguer that sources images according to an x value that is increased using keyDown. I have tried making it into a JComponent, using the paintComponent method, but the compiler says that the Image picture = getImage(getDocumentBase().... can't be referenced from a static context. Any help appreciated. thnx

Exuro
02-02-2005, 11:49 PM
try putting the static keyword in front of your variable declaration. That error usually arises when you try to access non-static variables from a static method (like main()).