{"id":58,"date":"2009-05-29T20:02:59","date_gmt":"2009-05-30T03:02:59","guid":{"rendered":"http:\/\/stupidzombie.com\/blog\/?p=58"},"modified":"2009-05-29T20:02:59","modified_gmt":"2009-05-30T03:02:59","slug":"matching-colors-on-the-java-gui","status":"publish","type":"post","link":"http:\/\/stupidzombie.com\/blog\/2009\/05\/29\/matching-colors-on-the-java-gui\/","title":{"rendered":"Matching colors on the Java GUI"},"content":{"rendered":"<p>OK, so no synth for now as I don&#8217;t really feel the need (yet) to create a full fledged theme for the GUI. However, will try to match as best as possible the official colors of the website and logo, and it seems than the easiest way is to use the UIDefault class:<\/p>\n<pre lang=\"Java\">\r\n\tpublic static final Color ZOMBIE_SKIN = new Color(140, 198, 63);\r\n\tpublic static final Color ZOMBIE_SKIN_LIGHTED = new Color(201,229,164);\r\n\tpublic static final Color ZOMBIE_UNIFORM = new Color(152, 84, 157);\r\n\tpublic static final Color ZOMBIE_TRIM = new Color(255,255,102);\r\n\t\r\n\t\r\n\tstatic {\r\n\r\n\t\tlog = Logger.getLogger(ZombieSkinChanger.class.getName());\r\n\t\t\r\n\t\tBUNDLE = ResourceBundle.getBundle(ZombieSkinChanger.class.getName());\r\n\t\t\r\n\t\t\/\/ Specific properties for OS X look and feel\r\n\t\tif (System.getProperty(\"os.name\").equals(\"Mac OS X\")) {\r\n\t\t\tSystem.setProperty(\"apple.awt.showGrowBox\", \"true\");\r\n\t\t\tSystem.setProperty(\"apple.laf.useScreenMenuBar\", \"true\");\r\n\t\t\tSystem.setProperty(\"com.apple.mrj.application.apple.menu.about.name\", StupidZombieGui.class.getSimpleName());\r\n\t\t\tSystem.setProperty(\"com.apple.mrj.application.growbox.intrudes\", \"true\");\r\n\t\t\tSystem.setProperty(\"apple.awt.brushMetalLook\", \"false\");\r\n\t\t}\r\n\r\n\t\t\r\n\t\tObject newSettings[] = {\r\n\t\t\t\t\"Button.background\", ZOMBIE_UNIFORM,\r\n\t\t\t\t\"TableHeader.background\", ZOMBIE_UNIFORM,\r\n\t\t\t\t\"TableHeader.foreground\", ZOMBIE_TRIM,\r\n\t\t\t\t\"Table.background\", ZOMBIE_SKIN_LIGHTED,\r\n\t\t\t\t\"ScrollPane.background\", ZOMBIE_SKIN,\r\n\t\t\t\t\"Panel.background\", ZOMBIE_SKIN,\r\n\t\t\t\t\"SplitPane.background\", ZOMBIE_SKIN,\r\n\t\t\t\t\"OptionPane.background\", ZOMBIE_SKIN,\r\n\t\t\t\t\"TextArea.background\", ZOMBIE_SKIN_LIGHTED,\r\n\t\t\t\t\"TextField.background\", ZOMBIE_SKIN_LIGHTED,\r\n\t\t\t\t\"EditorPane.background\", ZOMBIE_SKIN_LIGHTED,\r\n\t\t\t\t\"ViewPort.background\", ZOMBIE_SKIN,\r\n\t\t\t\t\"TabbedPane.background\", ZOMBIE_SKIN,\r\n\t\t\t\t\"CheckBox.background\", ZOMBIE_UNIFORM,\r\n\t\t\t\t\"CheckBoxMenuItem.background\", ZOMBIE_UNIFORM,\r\n\t\t\t\t\"Menu.background\", ZOMBIE_SKIN_LIGHTED,\r\n\t\t\t\t\"MenuItem.background\", ZOMBIE_SKIN_LIGHTED,\r\n\t\t\t\t\"MenuBar.background\", ZOMBIE_SKIN_LIGHTED,\r\n\t\t\t\t};\r\n\t\t\r\n\t\tUIDefaults defaults = UIManager.getDefaults();\r\n\t\tdefaults.putDefaults(newSettings);\r\n\r\n\t}\r\n<\/pre>\n<p>So here is how the GUI looks with the default values on OSX:<\/p>\n<p><a href=\"http:\/\/www.flickr.com\/photos\/josevnz\/3245886024\/\" title=\"stupidzombie by josevnz, on Flickr\"><img loading=\"lazy\" src=\"http:\/\/farm4.static.flickr.com\/3385\/3245886024_5fa4f26dc6.jpg\" width=\"500\" height=\"393\" alt=\"stupidzombie\" \/><\/a><\/p>\n<p>Not bad, but kind of boring.<\/p>\n<p>And this is how it looks after I apply the UIDefaults:<\/p>\n<p><a href=\"http:\/\/www.flickr.com\/photos\/josevnz\/3576924323\/\" title=\"StupidZombie GUI - Color schema UIDelegate #2 by josevnz, on Flickr\"><img loading=\"lazy\" src=\"http:\/\/farm3.static.flickr.com\/2453\/3576924323_2fa7a3e7e3.jpg\" width=\"500\" height=\"431\" alt=\"StupidZombie GUI - Color schema UIDelegate #2\" \/><\/a><\/p>\n<p>Another look at the tables:<\/p>\n<p><a href=\"http:\/\/www.flickr.com\/photos\/josevnz\/3577717102\/\" title=\"StupidZombie GUI - Color schema UIDelegate #1 by josevnz, on Flickr\"><img loading=\"lazy\" src=\"http:\/\/farm4.static.flickr.com\/3563\/3577717102_e12d8f9e5c.jpg\" width=\"500\" height=\"428\" alt=\"StupidZombie GUI - Color schema UIDelegate #1\" \/><\/a><\/p>\n<p>It is not exactly the colors of the website, so I tried to create a little bit of contrast by lightening up the original values (I used a really <a href=\"http:\/\/www.colorschemer.com\/online.html\">cool online tool<\/a>).<\/p>\n<p>So, what is next? Well, lots of stuff ahead:<\/p>\n<ul>\n<li>I plan to add new icons to the GUI (Romney is working on that), <\/li>\n<li>fix minor issues on the website<\/li>\n<li>fix the blog template<\/li>\n<li>Enable support for Spanish (ya me he tardado demasiado)<\/li>\n<li>Migrate the project from Java.net to Kenai.com<\/li>\n<\/ul>\n<p>Several of this items will get sorted out over the weekend, so stay tunned. Official 1.0 release is comming fast!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>OK, so no synth for now as I don&#8217;t really feel the need (yet) to create a full fledged theme for the GUI. However, will try to match as best as possible the official colors of the website and logo, and it seems than the easiest way is to use the UIDefault class: public static [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[4],"tags":[],"_links":{"self":[{"href":"http:\/\/stupidzombie.com\/blog\/wp-json\/wp\/v2\/posts\/58"}],"collection":[{"href":"http:\/\/stupidzombie.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/stupidzombie.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/stupidzombie.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/stupidzombie.com\/blog\/wp-json\/wp\/v2\/comments?post=58"}],"version-history":[{"count":11,"href":"http:\/\/stupidzombie.com\/blog\/wp-json\/wp\/v2\/posts\/58\/revisions"}],"predecessor-version":[{"id":69,"href":"http:\/\/stupidzombie.com\/blog\/wp-json\/wp\/v2\/posts\/58\/revisions\/69"}],"wp:attachment":[{"href":"http:\/\/stupidzombie.com\/blog\/wp-json\/wp\/v2\/media?parent=58"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/stupidzombie.com\/blog\/wp-json\/wp\/v2\/categories?post=58"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/stupidzombie.com\/blog\/wp-json\/wp\/v2\/tags?post=58"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}