---- 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
}
@Override protected void startup() {
show(new login(this)); //ERROR : can't find symbol
}
public static void main(String[] args) {
launch(login.class, args); //ERROR : application can't be
applied to ....
}
The errors indicate that there is no class defined in the project. But
in fact, there is a class named "login" in login.java. Do I missed
something ?
Probably an import. Is 'login' [sic] in package 'ecgterminal1'?
Class names should start with an upper-case letter. Lower-case first letters
are for (non-constant) variables and methods.
--
Lew
Yes. "login" is in package "ecgterminal1".
I'll try to change the name with upper-case letter.
"login" has been changed to "Login". But there's still error :
cannot find symbol
symbol : constructor Login(ecgterminal1.Main)
location : class ecgterminal1.Login
Any suggestion please ?
Your class Login does not have a constructor like the one you're
calling. It has a constructor with two parameters.
Either write a constructor with the parameters you want, or give the
existing one all its parameters.
Hi, I've tried to fix the problem, but these new errors occurred :
Sep 27, 2008 8:45:38 PM org.jdesktop.application.LocalStorage getId
WARNING: unspecified resource Application.id using Main
Sep 27, 2008 8:45:38 PM org.jdesktop.application.LocalStorage getId
WARNING: unspecified resource Application.vendorId using
UnknownApplicationVendor
What should I do ? Please advise. Thanks in advance.
Help please...
> > Hi, I've tried to fix the problem, but these new errors occurred :
> >
> > Sep 27, 2008 8:45:38 PM org.jdesktop.application.LocalStorage getId
> > WARNING: unspecified resource Application.id using Main
> > Sep 27, 2008 8:45:38 PM org.jdesktop.application.LocalStorage getId
> > WARNING: unspecified resource Application.vendorId using
> > UnknownApplicationVendor
> >
> > What should I do? Please advise. Thanks in advance.
I'm unfamiliar with the Swing Application Framework, but it might help
to read/work through the tutorial with your recent changes in mind:
<http://www.netbeans.org/kb/60/java/gui-saf.html>
I imagine your code has evolved since your first post:
<http://groups.google.com/group/comp.lang.java.programmer/msg/5ace78ceb85
2c045?hl=en>
It might help to post a revised sscce:
<http://pscode.org/sscce.html>
--
John B. Matthews
trashgod at gmail dot com
home dot woh dot rr dot com slash jbmatthews
Hmm... it was helpful. But the warning still appears. I don't have any
idea about this. But, thanks anyway.