Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JButton size changes

 
rajshkhr pandey
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • 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
 
Maneesh Godbole
Saloon Keeper
Posts: 11027
12
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out AbstractButton#setRolloverEnabled and JButton#setRolloverIcon
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic