Tag Archives: Background

Improving the Swing GUI with seamless textured background images

With the simple use of seamless textured background images, you can make a dramatic improvement in the appearance of your Swing GUI. Seamless textures are great because you can tile them horizontally and vertically to fit any component size.

Here are some more examples with different textures:

READ MORE »

How to add a Gradient Background to any JComponent

Almost every “web 2.0″ application have a cool linear gradient background instead of the plain old boring single color solid background. Adding a gradient background to your application is very simple with only a few lines of additional code. In the example program, I am using Java2D and the GradientPaint class to draw the linear gradient background.

Below is the program that I used to create the image above. We override the paintComponent of the JPanel (or any JComponent) and fill the background with a gradient paint. The begin and end colors for the gradient paint are derived from the component’s background color using the brighter and darker variations.

READ MORE »