• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

Button

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ..
 
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!
 
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic