I've prepared transparent Button class:
public MyButton() {
super("button");
setOpaque(false);
setContentAreaFilled(false);
setBorder(null);
setBorderPainted(false);
}
But button is not fully transparent. When it is clicked it looks like this:
Is there any way to avoid this annoying rectangle? There is no such problem in default L&F but I'd like to use SystemLookAndFeel.
You could do
setFocusPainted(false);
Note: All the above functionality can be achieved by just creating an instance of JButton
and using rather than sub-classing the component