No main class in small Java program + embedding as applet

ksmo92

New Member
I'm having an issue with my code. Specifically this. When I compile it in Netbeans it says " Could not find or load main class Form" but I see it right in the code...what am I doing incorrectly?Second of all, to embed it on a web page could I compile it and do ? Thank you for your help. I'm only a week into Java GUI stuff.\[code\]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(); } }); }}\[/code\]
 
Back
Top