Posts Tagged ‘Swing’

Swing tip : A better SwingWorker without exception swallowing

When we develop Swing applications, SwingWorker are very helpful. But there is a big disadvantage using this class. if you don’t call get() in the done method, you will lose all the exceptions that the computation in the doInBackground() has thrown. And you action can stop and you will never see why. In 95% of my actions using SwingWorker, the doInBackground() return nothing.
Jonathan Giles …

Java 7 : Translucency and shaped windows

Java 7 introduces very interesting features for desktop windows :

Transclucency for windows : Make a full window translucent with a specified alpha level
Per pixel translucency : Make a part of the window translucent.
Shaped windows : You can now create windows with a certain shape, like circle, ovale, triangle, …

We’ll see all this features in that post. All the examples are tested in Windows Seven …

Links of the week (April 20)

Some interesting links of the week :

Poll Results: We’re Not Quite Ready For Web Based IDEs : Interesting poll results on how the developers are ready about web based IDEs
How to localise a Play Framework application : Peter Hilton explain how internationalize a Play! Framework application
The Top 15 Google Products for People Who Build Websites
Swinging Task Dialog (part 5) : Eugene Ryzhikov continue …

Using Substance Look And Feel in OSGi

I experienced some problems with Substance in OSGi. Using this code :

SubstanceLookAndFeel.setSkin(new BusinessBlackSteelSkin());

I got different errors, like :
Exception in thread “AWT-EventQueue-0″ java.lang.NullPointerException at
org.pushingpixels.substance.internal.utils.SubstanceColorUtilities.getDefaultBackgroundColor(SubstanceColorUtilities.java:823)
I found a simple solution to make Substance work in OSGi :

try {
UIManager.setLookAndFeel(new SubstanceBusinessBlackSteelLookAndFeel());
} catch (UnsupportedLookAndFeelException e) {
LoggerFactory.getLogger(getClass()).error(e.getMessage(), e);
}
 
UIManager.getLookAndFeelDefaults().put("ClassLoader", SubstanceBusinessBlackSteelLookAndFeel.class.getClassLoader());

With that code, i’ve no more problems using Substance Look And …

Substance 6.0 is out

Kirill Grouchnikov has just announced the release of the final release of Substance 6.0. Substance is a really powerful look and feel for Java. This look and feel looks pretty good and is skinnable, you have several themes to apply to the look and feel to customize the appearance of your applications.
This version includes the following new features :

Multi-state animated transitions
New look for text components
Custom components …

Java Links of the week

I will try to reference my personal best of links about Java, Swing, … every week at monday.
Here is the most interesting links i found about Java Programming this week :

Swing event departure board : Gerrit of Java User Group Münster has developed an event departure board like those in the airports in Swing. with an amazing style.
Swinging Task Dialog Part 4 : Eugene …

Manage focus with Swing in Java

1. Introduction
The focus is the “selected” state of a component. The component who has the focus is the active component. It’s possible to ask focus fror a specific component but normally this is perfectly managed by Swing.
With this tutorial, you will learn how to ask focus for a specific component and how to define an order of focus. We will also learn a bit …

Creation of Swing User Interface : Tables (JTable)

This article will introduce you to the creation of tables in Swing with the JTable class. We will see the elementary concepts of JTable and how to do operations like sort/filter or dynamid add/remove datas to the table.