Code:public class Applet1 extends Applet { public String i_item; /** * The entry point for the applet. */ public void init() { xitem = new Class1(i_item); } public void paint(Graphics g) { } }
Ok, i want to be able to call the xitem in the paint sub. Sorry this is a basic question but this is my 3rd day doing this hehe
Anyways, i want to make it so i can do
But the thing is, when i put in xitem. the submenu wont pop up. It should have Draw inside because my Class1 has it. This is what it looks like.Code:public void paint(Graphics g) { xitem.Draw(); {
I know there are many errors, but what am i forgeting to make xitem equal to... i tried making itCode:import java.awt.*; public class Class1 { String x_item; public Class1(String x){ x_item = x; } public void DrawX(Graphics d){ d.drawString(x_item,20,20); } }
public xitem Class1;
before the init void but that dosent work.
??? Please help, im stuck damnit! :\






Reply With Quote