Quote:
Originally Posted by grail
How about you show us how you are currently calling it from main() and then we can see where you have gone wrong?
|
===========================================================
// this is the constructor i want to call
public class UserLogin extends javax.swing.JDialog {
/** Creates new form UserLogin */
public UserLogin(java.awt.Frame parent, boolean modal) {
super(parent, modal);
initComponents();
}
//and it has the main function
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
UserLogin dialog = new UserLogin(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);
}
});
}
============================================================
// in the main function of the project,main.java i tried calling it using
UserLogin ul=new UserLogin();
//which reports an error as no such constructor
===========================================================