Monthly Archives: January 2010

How to create a custom Swing Border

Dash Border

A dash border in Java Swing

Eventually every Swing developer comes to a point where the borders packaged with Java Swing is considered too plain. Either you will be googling for your next border or you become adventurous and create your own border. This tutorial is for the adventurous. I will teach you how to create your own dashing border. Anyone who done web development is already familiar with the border styled with alternating lines and spaces.

READ MORE »

Easy animated transitions in Java Swing with TimingFrameworks

clockCreating animated transitions use to be a tedious task in Java Swing… until TimingFrameworks came along. TimingFrameworks (https://timingframework.dev.java.net/), written by Chet Haase, is a library for making Java animation and timing-based control easier. There are two good introductory articles on their website worth reading.

Crash course in animation

Below is the code to move a JFrame 100 pixels from left to right in 1 second.

READ MORE »

How to use Swing Borders

Use the applet below to explore the set of borders already provided by Java Swing.

Java Swing provides a javax.swing.BorderFactory class with 8 set of factory methods to create 6 type of borders, 1 empty border and a set of factory methods to create compound borders.

READ MORE »