Tip Bank

DevX - Software Development Resource

Beginning Swing-Based Applications

When you begin all Swing-based applications, you must set the look and feel and add a WindowListener so that when a user clicks on the exit box, the program exits.

DevX - Software Development Resource

Using JToggleButtons Inside the JToolBar

JToggleButtons work well when you want buttons that stay down or up inside the JToolBar. You can also make them behave like Radio buttons (only one button down at a

DevX - Software Development Resource

Suppress Trailing Zeros on Output

The format string “%f” in printf() call displays trailing zeros of its argument: float num = 1.33; printf( “%f”, num); // output: 1.330000 To get rid of the trailing zeros,

DevX - Software Development Resource

Installing Own Colormap

Question: How can I make my Java application install its own colormap? Answer: The ability to allow a Java application to install its own colormap is not supported by the

DevX - Software Development Resource

JTable Headers

Question: I would like to add an icon to the header of a column of a JTable indicating the direction the column is currently sorted. Answer: It can be pretty

DevX - Software Development Resource

RMI method invocation

Question: I want my RMI server application to populate a java.awt.List with data on the client with a method invocation. What’s the best way to do this? Answer: When writing