I am using JButtons to display clickable thumbnails. The thumbnails are for images downloaded from the web. The code below is for the class ThumbnailButton, which extends JButton
public ThumbnailButton(String title, String id, String url) throws MalformedURLException
{
setIcon(new ImageIcon(new URL(url)));
setToolTipText(title);
setActionCommand(id);
setBackground(Color.WHITE);
//setBorder(BorderFactory.createLineBorder(Color.ORANGE, LINE_BORDER_WIDTH));
setMargin(new Insets(PADDING, PADDING, PADDING, PADDING));
}
The commented line changes the button's border to a thicker orange color. However, when I do this, the visual feedback from rolling over the image with the mouse pointer disappears. Without the line, when the user rolls their mouse over the image, the border changes from a thin black to a thick blue. Also, when you hold the mouse button down over the image, the margins of the button turn blue.
Basically I would like to emulate the same effect but with Orange instead of blue. What is the simplest way to do this?