Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Lewis Evans   on Jun 19 In Java Category.

  
Question Answered By: Geneva Morris   on Jun 19

1. set  the jButton2 visibility to false in the initComponents method.
2. fix the jButton1ActionPerformed method  as follows:

.....jButton1ActionPerformed(ActionEvent ae) {
boolean isVisible = jButton2.isVisible();
jButton2.setVisible(!isVisible);
}

This will toggle the jButton2 on and off.
The other thing that you can do using the JToggleButton instead
of jButton1.

Share: 

 

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

 
Didn't find what you were looking for? Find more on problem with swing Or get search suggestion and latest updates.


Tagged: