This class allows to add a rollover effect to a
JButton
. Rollover-enabled buttons have no borders by default. It is only when the mouse cursor is over the button that the button's borders get painted. This rollover effect gives the user a visual indication that the button can be pressed (in other words, that the button is indeed a button), while not cluttering the interface with button borders. Such buttons are particularly effective for toolbars, where a large number of buttons are usually present.
To 'rollover-enable' a button, the {@link #setButtonDecoration(javax.swing.JButton)} method must first be called toset decoration properties. Then, the button must register an instance of RolloverButtonAdapter
as a mouse listener. Note that a single RolloverButtonAdapter
instance can be registered with several buttons.
@author Maxence Bernard