0

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 JComponents, 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 JComponents present within the FileChooser: I was using underscores in my keys. 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...

nullromo
  • 2,165
  • 2
  • 18
  • 39
  • The JFileChooser is customizable. [Here is a place to start](http://www.javaworld.com/article/2074920/learn-java/enterprise-application-integration-customizing-swing-s-file-chooser.html). Just google `modifying the JFileChooser` for more. – DevilsHnd - 退職した Mar 20 '17 at 03:03
  • I've read through that article, but it doesn't address the questions that I am asking. And I know how to use Google. – nullromo Mar 20 '17 at 04:33

0 Answers0