Checkbox and If Statement
Hi Im new in Java programming and I use Netbeans I have 2 questions;
1- Is it possible to make checkboxes as buttons like in VB.Net or VB 6.0?
More Info: I want to change checkbox's style so that it looks like a button but if I click on it it will look like "still pressed button" (I dont hold the mouse but the button will look like that I would hold the mouse button :) ).
Image: http://img511.imageshack.us/my.php?image=checkoc4.jpg
2- I have read tutorials but I cannot find what I want. How can I put 2 or more conditions in an if statement? For example VB code would be like this I think you can easily understand it:
if MyName="Genom" and MyAge=4 then
...
Thanks for any help and sorry for my english. These things are really hard to explain.
> Hi Im new in Java programming and I use Netbeans I
> have 2 questions;
> 1- Is it possible to make checkboxes as buttons like
> in VB.Net or VB 6.0?
> More Info: I want to change checkbox's style so that
> it looks like a button but if I click on it it will
> look like "still pressed button" (I dont hold the
> mouse but the button will look like that I would hold
> the mouse button :) ).
>
> Image:
> http://img511.imageshack.us/my.php?image=checkoc4.jpg
Sounds like you are talking about a JToggleButton (I haven't looked at the picture)
>
> 2- I have read tutorials but I cannot find what I
> want. How can I put 2 or more conditions in an if
> statement? For example VB code would be like this I
> think you can easily understand it:
> if MyName="Genom" and MyAge=4 then
> ...
if (myName.equals("Genom") && myAge == 4) {
}
kajbja at 2007-7-12 18:27:18 >

> Hi Im new in Java programming and I use Netbeans I
> have 2 questions;
> 1- Is it possible to make checkboxes as buttons like
> in VB.Net or VB 6.0?
> More Info: I want to change checkbox's style so that
> it looks like a button but if I click on it it will
> look like "still pressed button" (I dont hold the
> mouse but the button will look like that I would hold
> the mouse button :) ).
>
> Image:
> http://img511.imageshack.us/my.php?image=checkoc4.jpg
Apologies if I've gotten this wrong, as I can't see your image (firewall), but I think you're looking for the JToggleButton.
http://java.sun.com/javase/6/docs/api/javax/swing/JToggleButton.html
> 2- I have read tutorials but I cannot find what I
> want. How can I put 2 or more conditions in an if
> statement? For example VB code would be like this I
> think you can easily understand it:
> if MyName="Genom" and MyAge=4 then
> ...
if (myName.equals("Genom") && myAge == 4) {
Message was edited by:
kevjava (<-- Doh! Too late.)