How to make hidden "Exit" button in java netbeans?

I want to create a hidden button in netbeans. Suppose if I click the "Next" button, then a new "Exit" button will appear in the same jFrame. Until I click the "Next" button, the "Exit" button will not be displayed. So how to do this? I mean, how to make a button that is included by default in .setVisible (false) in netbeans?

Please help me solve this problem.

+4
source share
2 answers

Since you already know that you know the correct method, I assume that you doubt Netbeans' work.

Right-click the method and select Configure Code.

Then you will have the opportunity to add the correct code after creating the button.

+6
source

Just use JButton.setVisible(false); immediately after creating the button.

+4
source

Source: https://habr.com/ru/post/1448038/


All Articles