Win a copy of Pipeline as Code this week in the Cloud/Virtualization forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Rob Spoor
  • Henry Wong
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh
  • Jj Roberts

Disabling JButton "pressed" feature

 
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 1535
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
This parrot is no more. It has ceased to be. Now it's a tiny ad:
SKIP - a book about connecting industrious people with elderly land owners
https://coderanch.com/t/skip-book
reply
    Bookmark Topic Watch Topic
  • New Topic