tray.SystemTrayProvider Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of native-tray-adapter Show documentation
Show all versions of native-tray-adapter Show documentation
Provides a simple adapter that makes the tray use gtk under linux,
providing a native look and feel.
The newest version!
package tray;
import tray.java.JavaTrayAdapter;
import tray.linux.LinuxNativeTrayAdapter;
public class SystemTrayProvider {
public SystemTrayAdapter getSystemTray() {
String osName = System.getProperty("os.name").toLowerCase();
if (osName.startsWith("linux")) {
try {
return new LinuxNativeTrayAdapter();
}catch(Exception e) {
}
}
return new JavaTrayAdapter();
}
}