Skip to content

Latest commit

 

History

History
38 lines (24 loc) · 2.4 KB

README.md

File metadata and controls

38 lines (24 loc) · 2.4 KB

Quaqua-JFC - pure Java JFileChooser for Mac

A fork of karlvr's Quaqua, which appears to be the official continuation of Werner Randelshofer's original work here: http://www.randelshofer.ch/quaqua/

Mr. Randelshofer did a awesome job on Quaqua for many years, but then he had to let it go. Perhaps due to less interest in Java on Mac, Java Swing, or he just got bored. You can tell by looking at the code (through the lens of what code looked like during the Java 1.5-1.6 era) that Randdelshofer cared deeply about responsiveness and accuracy of his look and feel.

I'd been using the Quaqua JFileChooser for years. It's hands-down THE BEST JFileChooser component for Mac. The default Swing one is barely usable for Mac users, so if any part of Quaqua needs to live on, it's this.

However, it had been aging not so gracefully. It relied on native code that sometimes crashed on new versions of macOS. It used outdated system resources to populate the sidebar. It really hasn't been substantively updated since at least macOS 10.9 (Mavericks).

My goal here is to try to morph Randelshofer's JFC into a pure Java implementation that works good enough on all Macs. Randelshofer put a lot of effort into making this component look exactly like the native one, but I'm going more for "close enough to native" but still leaps and bounds better than the Swing default.

Now that JavaFX is being spun out of Java, some may yet still find this useful.

Requirements/Dependencies

  • Java 8
  • TwelveMonkeys ImageIO 3.5-SNAPSHOT or newer, include these artifacts:
    • core
    • metadata
    • icns

Illegal Reflective Access Warnings in JDK9+

To hide the warnings about illegal reflective access, launch your app with the jvm paramater:

java --add-opens java.desktop/com.apple.laf=ALL-UNNAMED ...

This will hide the warnings, but this does not fix the issue. Future jdk could remove the ability to force allowing the reflective access if not explicity allowed by the library.

Code notes:

  • There are variations of the UI for every version of macOS up through Mavericks, but the last one to not rely on native code was the QuaquaLeopardFileChooserUI, so that's where my effort is focused. The QuaquaManager only provides this option for UI now.
  • QuaquaFileSystemView picks a macOS version-specific implementation of a FileSystemView. Ever since Lion, they all use OSXLionFileSystemView, so that's also where I focus.