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: Qadriyyah Malik   on Aug 06

you have this line:

if (button instanceof Button)

which will never evaluate to true as your 'OK' button  is a JButton
and this is not descended from Button. You could change it to:

if (button instanceof JButton)

though this is not really necessary as the line you have later is
sufficient to check that the OK button has been pressed:

if(button == ok)

You will have more problems when you get that part working, like when
you call

PasswordBox.setVisible(false)

You have variables with the same name as the class, PasswordBox,
which is VERY confusing.

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: