Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / November 2004

Tip: Looking for answers? Try searching our database.

Display boolean in a enquiry screen

Thread view: 
Shane Mingins - 02 Nov 2004 00:32 GMT
Hi

If I wish to display a boolean value as checkbox in an enquiry screen how
can I do it?

The problem I have is if I use a JCheckBox it is able to be checked on and
off.  But if I setEnabled(false) it appears greyed out which for an enquiry
screen is not wanted.

I have a similar issue with a JList on an enquiry screen

Thanks
Shane

Signature

"If A is success in life, then A equals x plus y plus z. Work is x; y is
play; and z is keeping your mouth shut." -- Albert Einstein

Andrew Thompson - 02 Nov 2004 05:07 GMT
> The problem I have is if I use a JCheckBox it is able to be checked on and
> off.  But if I setEnabled(false) ..

setSelected(false)

HTH

Signature

Andrew Thompson
http://www.PhySci.org/codes/  Web & IT Help
http://www.PhySci.org/  Open-source software suite
http://www.1point1C.org/  Science & Technology
http://www.LensEscapes.com/  Images that escape the mundane

Aki \ - 02 Nov 2004 11:17 GMT
>>The problem I have is if I use a JCheckBox it is able to be checked on and
>>off.  But if I setEnabled(false) ..
>
> setSelected(false)

Or, if you have a boolean variable and want to display its state:
setSelected(booleanVariable);

Signature

-Aki "Sus" Laukkanen

Thomas Weidenfeller - 02 Nov 2004 10:25 GMT
> If I wish to display a boolean value as checkbox in an enquiry screen how
> can I do it?

With a text string (JLabel), and not with a check box.

> The problem I have is if I use a JCheckBox it is able to be checked on and
> off.  But if I setEnabled(false) it appears greyed out which for an enquiry
> screen is not wanted.

A check box is not a suitable widget to visualize a boolean condition.
It is an interactive element for allowing the user to express a choice.

/Thomas


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.