T
tobleron
Hi, I'm trying to write a desktop application from the scratch by
using NetBeans IDE 6.1. I already created 2 files, which are main.java
and login.java. What I need is : when I run the application, the login
form which is called in login.java is directly launched. But I faced
errors in main.java. Please help me to fix it. Here are the codes :
---- main.java -----
package ecgterminal1;
import org.jdesktop.application.Application;
import org.jdesktop.application.SingleFrameApplication;
public class Main extends SingleFrameApplication {
@Override protected void startup() {
show(new login(this)); //ERROR : can't find symbol
}
@Override protected void configureWindow(java.awt.Window root) {
}
public static Main getApplication() {
return Application.getInstance(Main.class);
}
public static void main(String[] args) {
launch(login.class, args); //ERROR : application can't be
applied to ....
}
}
----- login.java -----
package ecgterminal1;
public class login extends javax.swing.JDialog {
public login(java.awt.Frame parent, boolean modal) {
super(parent, modal);
initComponents();
}
---- code generated by netbeans here -----
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
login dialog = new login(new javax.swing.JFrame(),
true);
dialog.addWindowListener(new
java.awt.event.WindowAdapter() {
public void
windowClosing(java.awt.event.WindowEvent e) {
System.exit(0);
}
});
dialog.setVisible(true);
}
});
}
// Variables declaration - do not modify
private javax.swing.JButton cancel;
private javax.swing.JLabel label;
private javax.swing.JButton login;
private javax.swing.JLabel passwd;
private javax.swing.JTextField passwdTxt;
private javax.swing.JLabel userID;
private javax.swing.JTextField userIDTxt;
// End of variables declaration
}
using NetBeans IDE 6.1. I already created 2 files, which are main.java
and login.java. What I need is : when I run the application, the login
form which is called in login.java is directly launched. But I faced
errors in main.java. Please help me to fix it. Here are the codes :
---- main.java -----
package ecgterminal1;
import org.jdesktop.application.Application;
import org.jdesktop.application.SingleFrameApplication;
public class Main extends SingleFrameApplication {
@Override protected void startup() {
show(new login(this)); //ERROR : can't find symbol
}
@Override protected void configureWindow(java.awt.Window root) {
}
public static Main getApplication() {
return Application.getInstance(Main.class);
}
public static void main(String[] args) {
launch(login.class, args); //ERROR : application can't be
applied to ....
}
}
----- login.java -----
package ecgterminal1;
public class login extends javax.swing.JDialog {
public login(java.awt.Frame parent, boolean modal) {
super(parent, modal);
initComponents();
}
---- code generated by netbeans here -----
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
login dialog = new login(new javax.swing.JFrame(),
true);
dialog.addWindowListener(new
java.awt.event.WindowAdapter() {
public void
windowClosing(java.awt.event.WindowEvent e) {
System.exit(0);
}
});
dialog.setVisible(true);
}
});
}
// Variables declaration - do not modify
private javax.swing.JButton cancel;
private javax.swing.JLabel label;
private javax.swing.JButton login;
private javax.swing.JLabel passwd;
private javax.swing.JTextField passwdTxt;
private javax.swing.JLabel userID;
private javax.swing.JTextField userIDTxt;
// End of variables declaration
}