I'm working on a game for a project in my computer science class. Is there a way to set visibility to false after pressing a button? I tried adding it into the action class associated with the button but it would't work. The main goal is to have my start button become invisible when I click start and at the same time set the visibility for the control buttons to true so that the control buttons show up when the game starts, rather than them already being on the screen.
That would make a very peculiar display with buttons appearing and disappearing mysteriously. Consider setEnabled(true) and setEnabled(false) instead. That would work for a Swing® display; you would use different methods in JavaFX.
Which IDE are you using? In NetBeans you can change a component`s properties. I know that for Swing Components you can use the 'componentName.setVisible(false);'. Please be specific about what type of components you want to make invisible.