Set background colour of applet RGB
authoramwaterhouse <Andrew Waterhouse>
Tue, 14 Jun 2005 11:32:45 +0000 (11:32 +0000)
committeramwaterhouse <Andrew Waterhouse>
Tue, 14 Jun 2005 11:32:45 +0000 (11:32 +0000)
src/jalview/bin/JalviewLite.java

index 35ebecc..2a411f7 100755 (executable)
@@ -40,7 +40,22 @@ public class JalviewLite extends Applet {
 \r
     public void init() {\r
         applet = this;\r
-        this.setBackground(Color.white);\r
+\r
+        int r=255,g=255,b=255;\r
+        String param = getParameter("RGB");\r
+        if(param!=null)\r
+        {\r
+          try\r
+          {\r
+            r = Integer.parseInt(param.substring(0,2),16);\r
+            g = Integer.parseInt(param.substring(2,4),16);\r
+            b = Integer.parseInt(param.substring(4,6),16);\r
+          }\r
+          catch (Exception ex)\r
+          { r=255;g=255;b=255; }\r
+        }\r
+\r
+        this.setBackground(new Color(r,g,b));\r
 \r
         file = getParameter("file");\r
 \r