java - JDialog inside a wrapper class does not appear -


i have login form instance of jdialog class. doesn't appear inside jframe. implemented inside application before method , worked. after wrapping inside login class not work there not error. problem?

public class application extends jframe {     jdialog loginform = null;     public application() {         setdefaultcloseoperation(jframe.exit_on_close);         setextendedstate(jframe.maximized_both);         setminimumsize(new dimension(800, 400));         setvisible(true);         loginform = (jdialog) new login();     }      public static void main(string[] args) {         try {             uimanager.setlookandfeel("com.alee.laf.weblookandfeel");             weblookandfeel.setdecoratedialogs(true);         } catch (exception e) {          }         application app = new application();     } }   public class login extends jdialog {     private jbutton loginbutton = null;     private jbutton cancelbutton = null;     private jtextfield usernamefield = null;     private jpasswordfield userpassfield = null;      public void login() {         //...         //...          setsize(new dimension(300, 200));         setresizable(false);         setlocationrelativeto(null);         setdefaultcloseoperation(jdialog.dispose_on_close);         settitle("login");         setvisible(true);         setalwaysontop(true);     }      class eventhandler implements actionlistener {         @override         public void actionperformed(actionevent e) {             if (e.getsource() == loginbutton) {                 string username = usernamefield.gettext();                 string password = security.getsha256(userpassfield.gettext());                 if(user.login(username, password)) {                     // login successful                 } else {                     // login failed. alert error                 }             } else if(e.getsource() == cancelbutton) {                 system.exit(0);             }         }     } } 

just change

public void login() 

to

public login() 

login not method, constructor.


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -