Tag Archives: Swing

Swing and Web Services Tutorial

Swing and web services have been around for many years, however it has only been in recent times that things have gotten much easier in implementing web services and building complex Swing applications. This is mainly due to improvements in … Continue reading


Posted in Swing, Tutorial | Tagged , , , , | Leave a comment

Swing and Design Patterns – Part 4. Mediator Pattern

Assume we have a component hierarchy that looks like the following diagram. Some component on one branch (say a button), wants to update something on another branch (say text in a text field). This scenario occurs very often in complex … Continue reading


Posted in Design Pattern, Swing, Swing Design Pattern | Tagged , , , | Leave a comment

Simple Pie Chart in Java Swing

Update ! This pie chart compoment has now been moved into the Iceberg Charts project . Please use Iceberg Charts for a more complete charting experience. I know there are a lot of Swing charting software libraries out there (JFreechart … Continue reading


Posted in Swing, Swing Components | Tagged , , , | 17 Comments

GridBagLayout Tutorial

This tutorial shows you how to construct a complex Java Swing GUI using the GridBagLayout. Let’s assume you have received a protoype sketch of how an application screen should look like, which you have been assigned to create : It … Continue reading


Posted in Swing, Tutorial | Tagged , , , , | 21 Comments

Swing and Design Patterns – Part 3. Command Pattern

  Command Pattern The command pattern is a commonly used pattern which encapsulates a method call or action-like code into a single class. The advantages of being able to package a method (or methods) into a class become evident when … Continue reading


Posted in Design Pattern, Swing Design Pattern | Tagged , , | 1 Comment

Swing and Design Patterns – Part 2. Delegate Pattern

Lets look at our diagram again and examine another pattern. Delegate Pattern (aka Facade) The delegate or facade pattern should be the backbone of all java Swing application (for that matter, not just Swing, but any desktop application that needs … Continue reading


Posted in Design Pattern, Swing Design Pattern | Tagged , , , , , , | Leave a comment

Swing and Design Patterns – Part 1. Decorator Pattern

I am going to talk a little about my experiences with design patterns, specifically when building a Swing application. Being the visual guy that I am, I decided to put together a little visual schematic showing the four most important … Continue reading


Posted in Design Pattern, Swing Design Pattern | Tagged , , , | 6 Comments

Advanced Swing Multithreading Tutorial

A lot of Swing tutorials on the internet focus on SwingWorkers and dealing with a single thread running concurrently to the Event Dispatch Thread (EDT). This tutorial is going to look at some more tricky techniques and traps that one … Continue reading


Posted in Swing, Tutorial | Tagged , , , , , , , | 3 Comments

Swing Textfield/TextArea Collapse on Dialog Resize

You might be working with Swing’s GridBagLayout and feel a little like … this guy because you see something like this : when all you wanted was this: This is because you are adding text to JTextArea. This causes a … Continue reading


Posted in Swing | Tagged , , , , , , | 1 Comment

Swing : Table Row Displayer in Dialog

Tables are great for displaying a matrix of information, however they show their limitations when they are showing a lot of columns, or they have columns displaying large amounts of text. For example : A lot of applications I have … Continue reading


Posted in Swing, Swing Components | Tagged , , , , , , , , | 4 Comments