> Once you move the mouse over the button, the border appears. When you move
> the mouse to an area outside the button, the border disappears.

Signature
Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology
YES :-)
Thanks again
I took your very precise words and search google groups, and I found
following code that I will try out.:
JButton button = new JButton(someText, someIcon);
ButtonHighlighter highlighter = new
ButtonHighlighter(button.getBackground());
button.setRolloverEnabled(true);
button.setBorderPainted(false);
button.addMouseListener(highlighter);
-------------------------------------------
import java.awt.event.*;
import javax.swing.*;
import java.awt.*;
Color normalColor;
Color brightColor;
public class ButtonHighlighter extends MouseAdapter
{
public ButtonHighlighter(Color normalColor)
{
this.normalColor = normalColor;
this.brightColor = normalColor.brighter();
}
public void mouseEntered(MouseEvent e)
{
((AbstractButton)e.getSource()).setBackground(brightColor);
((AbstractButton)e.getSource()).setForeground(Color.red);
((AbstractButton)e.getSource()).setBorderPainted(true);
}
public void mouseExited(MouseEvent e)
{
((AbstractButton)e.getSource()).setBackground(normalColor);
((AbstractButton)e.getSource()).setForeground(Color.black);
((AbstractButton)e.getSource()).setBorderPainted(false);
}
> > Once you move the mouse over the button, the border appears. When you move
> > the mouse to an area outside the button, the border disappears.
[quoted text clipped - 8 lines]
> Hopefully one of the Guru's will be
> along any moment.
Andrew Thompson - 30 Apr 2004 15:59 GMT
> I took your very precise words and search google groups,
A poster that knows how to Google.
Music to my ears. :-)
> ..and I found
> following code that I will try out.:
Excellent! Give us a hail if you
have any problems with it.

Signature
Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology
ak - 30 Apr 2004 21:40 GMT
> JButton button = new JButton(someText, someIcon);
> ButtonHighlighter highlighter = new
[quoted text clipped - 3 lines]
> button.setBorderPainted(false);
> button.addMouseListener(highlighter);
you can do also following:
1. Button#setRollover(true);
2.Button#setBorder(new
javax.swing.plaf.metal.MetalBorders.RolloverButtonBorder());
--
____________
http://reader.imagero.com the best java image reader.