I am working on my java code using combo box.............I compiled it and it says process complete....BUT.....I cannot view it in applet viewer.....whenever I click the play button, it displays "java.lang.NoSuchMethoderror:main" "Exception in thread "main".............
what do these mean???? How can I make it be displayed in the applet viewer??
here is the code....
import java.awt.*;
import java.applet.*;
public class CheckboxApplet extends Applet
{
Label label1;
Checkbox checkbox1;
Checkbox checkbox2;
Checkbox checkbox3;
public void init()
{
label1 = new Label("Who is the most beautiful?",0);
checkbox1 = new Checkbox("Suzumiya Haruhi", null, true);
checkbox2 = new Checkbox("Nam Gyu Ri", null, false);
checkbox3 = new Checkbox("Alodia Gosiengfiao", null, false);
add(label1);
add(checkbox1);
add(checkbox2);
add(checkbox3);
}
public void paint(Graphics g)
{
Font font = g.getFont();
FontMetrics fontMetrics = g.getFontMetrics(font);
int height = fontMetrics.getHeight();
boolean checked = checkbox1.getState();
if (checked)
g.drawString("Suzumiya Haruhi: NO! not me....", 20, 120);
else
g.drawString("Suzumiya Haruhi: not selected", 20, 120);
checked = checkbox2.getState();
if (checked)
g.drawString("Nam Gyu RI: Yes it's me! YOU GOT IT!", 20, 120 + height);
else
g.drawString("NAm Gyu Ri: not selected", 20, 120 + height);
checked = checkbox3.getState();
if (checked)
g.drawString("Alodia Gosiengfiao: are you kidding? ME?", 20, 120 + 2 * height);
else
g.drawString("Alodia Gosiengfiao: not selected", 20, 120 + 2 * height);
}
public boolean action(Event evt, Object arg)
{
repaint();
return true;
}
}