What you suggest is technically possible, but the approach is fragile for any but the most well-encapsualted default used by a well-behaved UI delegate implementation. In this example, a borrowed JTree
icon is shown. For your application, the relevant key is "EditorPane.font". If you change it, some things to keep in mind:
Prefer a logical font family to a physical font, e.g.
Font.SANS_SERIF
orFont. DIALOG
.Consider using the
deriveFont()
method to alter the existing default.Test extensively on your target platform(s).
Consider an alternate approach, where possible.