I have a program with quite a few JDialogs
, JFileChoosers
and other components containing JButtons
.
I know I could go from JButton
to JButton
and set .focusPainted(false)
to make focus invisible, but the problem is that I have a bunch of "automatically" created components (Predefined JDialogs, JFileChoosers), and I don't have access to their JButton. I'd have to create whole components manually to be able to control their sub-components (and creating a fileChooser from scratch has to be difficult)...
However, I have an idea. Everytime a JButon is created, focusPainted
is set to true
by default. Is there a way I could find the Java library containtng original JButton constructor(s) and change the method to be false
there, making that the default?
EDIT: I found src.zip and extracted AbstractButton.java. How do I edit and recompile it?
Actually, the question is, how do I edit Java standard libraries?
P.S. All you folks saying it's not a good practise, what could go wrong with this specific example (I don't think that anyting in JSL depends on whether focus is painted on a Jbutton or not)? And I could always work on two project simultaniously, one with original libaries, and one with edited, and when I get error in one, but not in the other, I know where's the problem lies.