This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes How to make buttons active and non-active Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "How to make buttons active and non-active" Watch "How to make buttons active and non-active" New topic
Author

How to make buttons active and non-active

adeeb alexander
Ranch Hand

Joined: May 29, 2008
Posts: 268
Hi,
I don't know what words to use. But on a panel using cardlayout i have added many cards and. On the first card i have a text field and a password field
i have already stored those username and password and when i press the ok button i enters the next card, till here its fine and works good.
Now the actual problem:
I have even added few buttons like next and previous which can be seen on every card using BorderLayout. If i press the next button instead of entering the details and pressing ok the next card is displayed. So i want to deactivate these buttons just on first card how to do that.Please some body help.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 37953
    
  22
On things like buttons you can use the setEnabled method. It takes a boolean, true or false. I think they are enabled by default.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: How to make buttons active and non-active
 
Similar Threads
JRadioButtons in applet
Problem with Text Fields
"Any body Help, Urgent"
Regarding CardLayout
Regarding Login