Note that there are some explanatory texts on larger screens.

plurals
  1. POimproving JFileChooser under Ubuntu 12.04 (GTK)
    text
    copied!<p>I have a problem with the <code>JFileChooser</code> under Ubuntu 12.04. I use this code to set the look and feel: <code>javax.swing.UIManager.setLookAndFeel(javax.swing.UIManager.getSystemLookAndFeelClassName());</code></p> <p>And it looks like this. It's very uncomfortable to use and it looks very ugly:</p> <p><a href="http://www9.picfront.org/token/9sRH/2012/05/15/2062476.jpg" rel="nofollow noreferrer">http://www9.picfront.org/token/9sRH/2012/05/15/2062476.jpg</a></p> <p>I would like it to look like this:</p> <p><a href="http://www4.picfront.org/token/1lpa/2012/05/15/2062477.jpg" rel="nofollow noreferrer">http://www4.picfront.org/token/1lpa/2012/05/15/2062477.jpg</a></p> <p>Using the hint from this <a href="https://stackoverflow.com/questions/4983575/is-there-a-way-to-improve-jfilechooser-look-and-feel-under-ubuntu">post</a>, I tried to use <code>FileDialog</code> instead of the <code>FileChooser</code>. But <code>FileDialog</code> throws an exception when i start it in <code>LOAD</code> mode and click on the "open" button. The way i create the Dialog:</p> <pre><code>FileDialog fd = new FileDialog(frame, "Test", FileDialog.LOAD); fd.setVisible(true); </code></pre> <p>The Exception:</p> <pre><code>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) </code></pre> <p>I am using Oracle JDK7 under Ubuntu Linux 12.04 with Gnome 3 (if this helps).</p> <p>Does anybody got an idea how either i could improve the look of the <code>JFileChooser</code> or get the <code>FileDialog</code> working?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload