Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Koila Malik   on Aug 06 In Java Category.

  
Question Answered By: Casey Montgomery   on Aug 06

as I said last time, you have a member variable with the same name as the class:

private JFrame PasswordBox;

this is a bad idea anyway. You don't actually use this variable, so just delete
the above line. In actionPerformed() you could replace this:

PasswordBox.setVisible(false);
PasswordBox.dispose();

with this:
this.setVisible(false);
this.dispose();

Which at least makes the window disappear when you enter the correct username &
password though it leaves the program running with no way of quiting it,
depending on the OS you are using.

Share: 

 

This Question has 3 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on the frame should close when the button 'OK' is clic Or get search suggestion and latest updates.


Tagged: