Mysteries of Nimbus

About defaults in Nimbus: Nimbus Defaults (originates from: Nimbus UIManager UIDefaults) Misc Textarea background issue Update: 10.7.2010 Skinning a Slider with Nimbus

Read more

Some nice code snippets

Code snippets. When doing tricks with Graphics 2D, it’s good to keep around utility to allow determining what different AlphaComposite operations are actually doing (in order to retain your sanity).

Read more

Advanced MultiThreading in Swing

Usually when multithreading in Swing is discussed, then authors are regarding trivial issue of using ”SwingWorker” and such constructs for running worker threads from EDT (Event Dispatch Thread”. However, Swing design includes one rather different multithreading thing. Namely it’s possible to start multiple AppContext instances, and execute multiple EDT threads in single JVM. So lets…

Read more

Speed up Java2D (& Swing) in Linux

Using -Dsun.java2d.opengl=true as startup argument for java when starting application using Java2D heavily (well, basically any Swing application), it improves noticeably performance in Linux environment. Currently I’m experimenting following settings in my /etc/profile.local -file. [code] _JAVA_OPTIONS=’-Xverify:none -Dsun.java2d.opengl=true’ export _JAVA_OPTIONS [/code] (_JAVA_OPTIONS is magic environment variable which is used automatically by java). I tested performance by…

Read more

Calculating JTextComponent -height

Problem: Let’s assume that we know the available width and we should determine what is the required height for JTextComponent within that limitation. This problem arises immediately, at least in three cases in java: Variable row height table cells Tooltip size Message dialog size In all of these cases, it is necessary sometimes to know…

Read more