diff options
Diffstat (limited to 'java')
-rw-r--r-- | java/com/tigervnc/vncviewer/Viewport.java | 17 | ||||
-rw-r--r-- | java/com/tigervnc/vncviewer/VncViewer.java | 12 |
2 files changed, 13 insertions, 16 deletions
diff --git a/java/com/tigervnc/vncviewer/Viewport.java b/java/com/tigervnc/vncviewer/Viewport.java index e7d76a54..8cb87b6f 100644 --- a/java/com/tigervnc/vncviewer/Viewport.java +++ b/java/com/tigervnc/vncviewer/Viewport.java @@ -42,23 +42,8 @@ public class Viewport extends JFrame setTitle(name+" - TigerVNC"); setFocusable(false); setFocusTraversalKeysEnabled(false); - if (VncViewer.os.startsWith("mac os x")) { - try { - Class appClass = Class.forName("com.apple.eawt.Application"); - Method getApplication = - appClass.getMethod("getApplication", (Class[])null); - Object app = getApplication.invoke(appClass); - Class paramTypes[] = new Class[1]; - paramTypes[0] = Image.class; - Method setDockIconImage = - appClass.getMethod("setDockIconImage", paramTypes); - setDockIconImage.invoke(app, VncViewer.logoImage); - } catch (Exception e) { - vlog.debug("Could not set OS X dock icon: " + e.getMessage()); - } - } else { + if (!VncViewer.os.startsWith("mac os x")) setIconImage(VncViewer.frameIcon); - } UIManager.getDefaults().put("ScrollPane.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[]{})); sp = new JScrollPane(); diff --git a/java/com/tigervnc/vncviewer/VncViewer.java b/java/com/tigervnc/vncviewer/VncViewer.java index e63ec3b1..8d9b23a6 100644 --- a/java/com/tigervnc/vncviewer/VncViewer.java +++ b/java/com/tigervnc/vncviewer/VncViewer.java @@ -39,6 +39,7 @@ import java.io.InputStream; import java.io.IOException; import java.io.File; import java.lang.Character; +import java.lang.reflect.*; import java.util.jar.Attributes; import java.util.jar.Manifest; import java.util.*; @@ -75,6 +76,17 @@ public class VncViewer extends javax.swing.JApplet public static void setLookAndFeel() { try { + if (os.startsWith("mac os x")) { + Class appClass = Class.forName("com.apple.eawt.Application"); + Method getApplication = + appClass.getMethod("getApplication", (Class[])null); + Object app = getApplication.invoke(appClass); + Class paramTypes[] = new Class[1]; + paramTypes[0] = Image.class; + Method setDockIconImage = + appClass.getMethod("setDockIconImage", paramTypes); + setDockIconImage.invoke(app, VncViewer.logoImage); + } // Use Nimbus LookAndFeel if it's available, otherwise fallback // to the native laf, or Metal if no native laf is available. String laf = System.getProperty("swing.defaultlaf"); |