alexfromsun's blog
Swing in a better world: Static fields vs AppContext
The problems that are related to the application context might be invisible from the outside of the Swing core libraries, but it has been a big deal for the Swing toolkit developers. Every time when you create a mutable static field in a Swing class you potentially introduce a security whole. It is quite surprising that an ordinary pattern of the Java language becomes a problem.
Swing in a better world: Compound components
Swing makes it very easy to control and modify simple components like JLabel or JButton. It gets trickier when you customize a compound component like JTree or JTable. Unlike a simple component, JTable consists of multiple subcomponents like table header, renderer and editor, so actually JTable is not a single component but a container with several descendants.
Swing in a better world: Listeners
In the list of the things that needs improving in Swing, the implementation of listeners takes the first place. The problem is the fact that the order in which listeners are notified is not specified and it is not even guaranteed that your listeners will be notified after the Swing system listeners.
Swing in a better world: Generics and arrays
Swing in a better world: Checked exceptions
Swing in a better world: java interfaces
We have all read the "Effective Java" book and know that we should prefer interfaces over abstract classes.
This is a known and respected pattern which should be used wherever possible.
However the years in the JDK team tauhgt me not to blindly trust
to good practices from the world of application programming.
Swing in a better world
I truly love the Swing GUI toolkit, I enjoy its flexibility, opennes and great abilities.
I know that some people say that Swing is too difficult to learn,
and I partly accept it because it took me several years working in the Swing team
to get the whole picture of the AWT, Java 2D and the Swing itself.
The alternative Swing frameworks
SAF and JDK7
Hello Swing community
After much discussion it's become clear that the Swing Application Framework API as it is today hasn't reached consensus and we feel still needs further design work done.
Since the SAF API was committed to milestone 5 of JDK7 and that time is already here, this date is now impossible, and we need to decommit SAF f
JDK 7 is moving forward!
Among all other changes, the latest build #b57 contains the fix for





