This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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 Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Button" Watch "Button" New topic


Maha Pratap

Joined: Jun 18, 2002
Posts: 4
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

Joined: Dec 10, 2001
Posts: 7023
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
the jbutton has built-in functions for the same.
jbutton go = new JButton();
then you have methods to set the icon of the image according to the event:
and so on... check the java documentation for a full list of methods...
hope this helps...
Maha Pratap

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...
[ June 20, 2002: Message edited by: meera sood ]
subject: Button
Similar Threads
Delete Records When user clicks close button of a browser
How do i capture HtmlCommandButton click
Lock Desktop Using Java
How to change the button size dynamically ?
Diffterent action from different button