Apart from using button.setVisible(false), is there an easy way to set a set of jButtons to invisible and visible again?
The algorithm is as follows – when the user clicks the checkout button, a set of payment buttons(denomination buttons are displayed). Trying to research if there is an easier way to accomplish this.
The better solution is to have your buttons in an array or
List, but if you can’t do that, you can walk the immediate container (JPanel) looking for all the components that are instances ofJButtonThis is a little heavy handed so be careful