• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Rob Spoor
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Carey Brown
Bartenders:

Visibility Options

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi y'all,

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.

Thanks!!
 
Saloon Keeper
Posts: 9832
80
Eclipse IDE Firefox Browser MySQL Database VI Editor Java Windows
 
Marshal
Posts: 77179
370
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic