• Post Reply Bookmark Topic Watch Topic
  • New Topic

Disabling JButton "pressed" feature

 
David Irwin
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All,

I'm using the JButton built-in rollover effect (setRolloverIcon, etc.) and the icons change when the user moves their mouse over the button. However, one annoying effect that I'm trying to remove is that when the user actually presses or clicks on the button you can see the outline of the actual button (this is because the icon doesn't cover the entire button). Is there a way to disable the button's "pressed" feature so that nothing visually happens when it's pressed or clicked (and I would like it for just this one button, not all of the buttons in my app)?

I'm using the JGoodies XP L&F along with JDK1.5_07.

Dave
 
Craig Wood
Ranch Hand
Posts: 1535
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the JButton api scroll down to the section Methods inherited from class javax.swing.AbstractButton. This class has methods for doctoring the appearance of your JButton. Check out setFocusPainted, setContentAreaFilled and setBorderPainted.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!