• 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
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JButton size changes

 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello to all,

I am developing an application in which I have used JToolBar with JButtons.
I am using the images instead of text as in following code



The image named save_big.jpg is of 20 X 20 and save.jpg is of 16 X 16
The problem arise when the mouse event occurs the button size resizes instead of the image i.e. on mouse entered event the button becomes big and on mouse exited event the button retains normal size as before.
I might be be because of the change in the size of image. I want the mouse hover effect on the button.
Also the image remains in the center of the button but I want the whole button to be covered by image.
Can anyone help me please.
Thank in advance
 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Check out AbstractButton#setRolloverEnabled and JButton#setRolloverIcon
reply
    Bookmark Topic Watch Topic
  • New Topic