I'm having trouble defining a custom style for JFileChooser
with synth. Simply binding a synth style to type="region" key="FILE_CHOOSER"
does not work (results in Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at sun.swing.plaf.synth.SynthFileChooserUI.update(Unknown Source), etc. etc. etc.
)
I thought that maybe a FileChooser
was made up of other standard JComponent
s, but even when I bind a style to every single Region
type, I still get the AWT stack dump and the file chooser doesn't display at all.
Additionally, I haven't been able to find a way to customize a FileChooser
beyond a few simple things like changing the accept/cancel buttons. I want to disable/change other buttons like the "change the way files are displayed" button or the "go up one folder" button.
It seems I may have to make my own FileChooser
-like GUI element, but I'd rather not. Is there a way to control the built-in one better?
EDIT: I figured out why I wasn't able to override the JComponent
s present within the FileChooser
: I was using underscores in my key
s. But that still leaves the question of how to customize the rest of the buttons in the FileChooser
. Some parts of the GUI don't even show up at all once a synth style is implemented...