AppletTalk.com Forum Index AppletTalk.com
Java discussions newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Jcheckbox.IsSelected()

 
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java Help
View previous topic :: View next topic  
Author Message
robguay
Guest





PostPosted: Thu Apr 29, 2004 5:15 pm    Post subject: Jcheckbox.IsSelected() Reply with quote



String myValue;

boolean killuniverse = myCheckBox.isSelected();

if (killuniverse == true);
{
myValue = "Box Was Checked";
}


This seems to be true all the time.

Checked or Not Checked.

I do not understand.
Back to top
Andrew Thompson
Guest





PostPosted: Fri Apr 30, 2004 3:01 am    Post subject: Re: Jcheckbox.IsSelected() Reply with quote



On 29 Apr 2004 10:15:42 -0700, robguay wrote:

Quote:
String myValue;
.....


I think you need to give a complete (short!) example..
<http://www.physci.org/codes/sscce.jsp>

--
Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology

Back to top
Fahd Shariff
Guest





PostPosted: Fri Apr 30, 2004 8:10 am    Post subject: Re: Jcheckbox.IsSelected() Reply with quote



No it is not true all the time!
---------
JCheckBox box = new JCheckBox() ;
box.setSelected(false) ;
System.out.println(box.isSelected()) ;
box.setSelected(true) ;
System.out.println(box.isSelected()) ;
----------

prints out:
false
true

Maybe you should give details of the entire program... (e.g. are u
using a action listener on the checkbox etc etc)

Fahd
http://www.fahdshariff.cjb.net

[email]robguay (AT) yahoo (DOT) com[/email] (robguay) wrote in message news:<109455be.0404290915.3c880b47 (AT) posting (DOT) google.com>...
Quote:
String myValue;

boolean killuniverse = myCheckBox.isSelected();

if (killuniverse == true);
{
myValue = "Box Was Checked";
}


This seems to be true all the time.

Checked or Not Checked.

I do not understand.

Back to top
Display posts from previous:   
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.