Beautifying a SWT application on Mac

java, macos, swt

Solution

This is usually problem of Swing not SWT (SWT is directly linked to OS/framework provided widgets) - a quote from A gentle introduction to SWT and JFace 2:

SWT is a library that creates a Java view of the native host operating system GUI controls. It is host implementation-dependent. This means SWT-based applications have several key characteristics: 1. They look, act, and perform like "native" applications. 2. The widgets provided reflect the widgets (the components and controls) provided on the host operating system. 3. Any special behavior of the host GUI libraries is reflected in SWT GUIs.

The pre 3.5 Milestone used to use Carbon framework and now the 3.5+ supports both 32/64bit Cocoa framework 1 so perhaps that has caused you confusion? Or can you be more specific, give us the version you use and some screenshots / sample code to reproduce?

I have been developing java application based on SWT/Eclipse RCP for a while on OSX and have not found and major problem with look&feel (of cause it does not 100% comply the Apple HID 3 as it complies with Eclipse UIG)

Problem

SWT is designed to be cross-platform, so it can run on a Mac. The problem is it commits the cardinal sin of Macland - it's UGLY. Toolbars don't look like Mac toolbars, status bars don't look like Mac status bars, etc. Does anyone have any experience in making an SWT application look more like a Mac application? For example, by making platform-specific JNI calls via the 'OS' class in SWT? If so, how difficult was it? (This question arises because we are looking at porting an existing SWT app designed to run on Windows) Thanks

Original source