aspose file tools*
The moose likes Java in General and the fly likes Button Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Button" Watch "Button" New topic
Author

Button

Maha Pratap
Greenhorn

Joined: Jun 18, 2002
Posts: 4
Hey,
Does JButton object recognise item events?, 'coz in my application I want to have a button which should display some results depending upon the state of the button(selected or deselected). I know I can use check box instead of button but ... could some one help me in clearing my fundas? ... thanks ..
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
MahaPratap,
Welcome to JavaRanch!
We ain't got many rules 'round these parts, but we do got one. Please change your display name to comply with The JavaRanch Naming Policy.
Thanks Pardner! Hope to see you 'round the Ranch!


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
meera sood
Ranch Hand

Joined: Dec 18, 2001
Posts: 50
hi!
the jbutton has built-in functions for the same.
eg.
jbutton go = new JButton();
then you have methods to set the icon of the image according to the event:
eg
go.setSelectedIcon(Icon);
go.setRolloverIcon(Icon);
go.setPressedIcon(Icon);
and so on... check the java documentation for a full list of methods...
hope this helps...
meera
Maha Pratap
Greenhorn

Joined: Jun 18, 2002
Posts: 4
Hey meera,
When I say "display" some results , I mean to say that some other check boxes should change state according to the state of the button and not exactly *display * some icons or images.. Thanks ..
meera sood
Ranch Hand

Joined: Dec 18, 2001
Posts: 50
oops sorry..... got u wrong!!!
anyways, wouldn't a click make the button selected???...just a thought...
meera
[ June 20, 2002: Message edited by: meera sood ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Button