web - No main class in small Java program + embedding as applet -
i'm having issue code. this. when compile in netbeans says " not find or load main class form" see right in code...what doing incorrectly?
second of all, embed on web page compile , ? thank help. i'm week java gui stuff.
package gui; import java.applet.applet; import java.awt.*; import java.awt.eventqueue; import java.awt.gridlayout; import javax.swing.*; class form { private static void display() { jtextfield field1 = new jtextfield(); jtextfield field2 = new jtextfield(); jtextfield field3 = new jtextfield(); jtextfield field4 = new jtextfield(); jtextfield field5 = new jtextfield(); jpanel panel = new jpanel(new gridlayout(0, 1)); panel.add(new jlabel("username:")); panel.add(field1); panel.add(new jlabel("password:")); panel.add(field2); panel.add(new jlabel("repeat password:")); panel.add(field3); panel.add(new jlabel("email address:")); panel.add(field4); panel.add(new jlabel("repeat email address:")); panel.add(field5); int result = joptionpane.showconfirmdialog(null, panel, "form", joptionpane.ok_cancel_option, joptionpane.plain_message); } public static void main(string[] args) { eventqueue.invokelater(new runnable() { @override public void run() { display(); } }); } }
make class public , main method found , run properly.
Comments
Post a Comment