I have a problem with the JFileChooser
under Ubuntu 12.04. I use this code to set the look and feel:
javax.swing.UIManager.setLookAndFeel(javax.swing.UIManager.getSystemLookAndFeelClassName());
And it looks like this. It's very uncomfortable to use and it looks very ugly:
(source: picfront.org)
I would like it to look like this:
(source: picfront.org)
Using the hint from this post, I tried to use FileDialog
instead of the FileChooser
. But FileDialog
throws an exception when i start it in LOAD
mode and click on the "open" button.
The way i create the Dialog:
FileDialog fd = new FileDialog(frame, "Test", FileDialog.LOAD);
fd.setVisible(true);
The Exception:
Exception in thread "Thread-0" java.lang.NullPointerException
at sun.awt.X11.GtkFileDialogPeer.setFileInternal(GtkFileDialogPeer.java:79)
at sun.awt.X11.GtkFileDialogPeer.run(Native Method)
at sun.awt.X11.GtkFileDialogPeer.showNativeDialog(GtkFileDialogPeer.java:172)
at sun.awt.X11.GtkFileDialogPeer.access$000(GtkFileDialogPeer.java:39)
at sun.awt.X11.GtkFileDialogPeer$1.run(GtkFileDialogPeer.java:114)
I am using Oracle JDK7 under Ubuntu Linux 12.04 with Gnome 3 (if this helps).
Does anybody got an idea how either i could improve the look of the JFileChooser
or get the FileDialog
working?