This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes setEnabled (false) doesn't work Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "setEnabled (false) doesn Watch "setEnabled (false) doesn New topic
Author

setEnabled (false) doesn't work

Matthew Helling
Greenhorn

Joined: Mar 18, 2004
Posts: 17
folks
I've got a problem and I'm stumped. I have 2 snippets of code (they are checkboxes) and when checked, should disable another checkbox.
The problem is, only one of them works. I've looked at the code a hundred times and can't figure it out.
Also, in a perfect world unchecking the box would "un-gray" the other option. That doesn't work, but I was able to add code to the reset button which will enable all checkboxes.
Please take a look and offer any advice you can.
Matthew Helling
Greenhorn

Joined: Mar 18, 2004
Posts: 17
ok, I found the bug, this is really weird.
Because in my server declarations I never had Email Server = false, the code wouldn't run for checking the box. once i set one of the server objects to false, it started working.
goofy. hope someone learns something.
I could still use some help un-graying boxes if anyone has any ideas. When I uncheck the box, it "Undos" the other effects, but not the setEnabled (false).

matt
[ March 24, 2004: Message edited by: Matthew Helling ]
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

Instead of using setEnabled( false ), you could base the boolean value off whether the current checkbox is checked. After you're finished with all the tests, have something like this -


[ March 25, 2004: Message edited by: Nathan Pruett ]

-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: setEnabled (false) doesn't work
 
Similar Threads
applet gui issues
for Applet
Struts, Iterate/Index/Checkboxes
Buttons...
tictactoe help