Make the Swing LookAndFeel consistent between applet mode and standalone mode.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4890 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/java/com/tigervnc/vncviewer/VncViewer.java b/java/com/tigervnc/vncviewer/VncViewer.java
index f3896b3..850f5f1 100644
--- a/java/com/tigervnc/vncviewer/VncViewer.java
+++ b/java/com/tigervnc/vncviewer/VncViewer.java
@@ -61,7 +61,7 @@
public static String version = null;
public static String build = null;
- public static void main(String[] argv) {
+ public static void setLookAndFeel() {
try {
String os = System.getProperty("os.name");
if (os.startsWith("Windows")) {
@@ -80,7 +80,13 @@
}
}
UIManager.put("TitledBorder.titleColor",Color.blue);
- } catch (java.lang.Exception exc) { }
+ } catch (java.lang.Exception e) {
+ vlog.info(e.toString());
+ }
+ }
+
+ public static void main(String[] argv) {
+ setLookAndFeel();
VncViewer viewer = new VncViewer(argv);
viewer.firstApplet = true;
viewer.stop = false;
@@ -232,6 +238,7 @@
public void init() {
vlog.debug("init called");
+ setLookAndFeel();
setBackground(Color.white);
ClassLoader cl = this.getClass().getClassLoader();
ImageIcon icon = new ImageIcon(cl.getResource("com/tigervnc/vncviewer/tigervnc.png"));