PDA

Click to See Complete Forum and Search --> : New Frame


jeric_mandrake
May 28th, 2006, 10:34 AM
hei,, its very simple...

i have a login frame in my app,the question is..
how will i show the main frame after i clicked the "Ok" button??? thanks...

manavo11
May 28th, 2006, 11:10 AM
This? In your action listener for the OK button? Or are you having trouble with implementing an action listener?

MainWindow MW = new MainWindow();
MW.pack();
MW.show();

ComputerJy
May 28th, 2006, 11:25 AM
This? In your action listener for the OK button? Or are you having trouble with implementing an action listener?

MainWindow MW = new MainWindow();
MW.pack();
MW.show();
fatal mistake don't ever use the: frame.show(); always use
frame.setVisible(true);

Another thing, I don't think a main window is something you create on click you make it visible, you don't want changes to be discarded