Client-Side Development Section Index | Page 9
Added to JDK 6, you call the print() method of JTextComponent to do this. Prior versions required you to paginate things yourself.
To discover the installed set of readers and writers, you simply ask the ImageIO class through its getReaderFormatNames() and getWriterFormatNames() methods. You can also get the set of mime types...more
You can get the default writing parameters for a specific ImageWriter through its getDefaultWriteParam() method. The method returns an ImageWriteParam object. For JPEGs, this happens to be an inst...more
Im looking for the simpliest TTT source code, 3x3 matrix...Human vs Human. If anyone have it, please show me the script.
Here is a TicTacToe applet/application hybrid. It runs as an applet in a browser and as an application when launched from the command prompt. import java.awt.*; import java.awt.event.*; import j...more
I want the user to be able to input tabs in my application, but the tab character moves the input focus to the next component in the app and my application's keylistener gets nothing. Is there any way to change this behaviour ?
The tab is a focus traversal key by default and you have to change this to catch the tab entries in your keylistener. You do this by overriding the Component method : getFocusTraversalKeys(int id)...more
Patent restrictions didn't allow a GIF writer to be part of the Java platform prior to JDK 6. With the recent expiration of the Unisys patent, JDK 6 includes support. import javax.imageio.*; impo...more
The Java 6 Desktop class has a mail() method for just such an action.
Java 6 offers a SystemTray class for this. Users of prior versions of Java can add this through the JDesktop Integration Components (JDIC) available from https://jdic.dev.java.net/. You'll find a ...more
There is an SDK available from Sourceforge (http://tivohme.sourceforge.net/ called the Home Media Engine (HME). This is the 'officially' supported product and allows you to add your own programs t...more
You can call reset() to remove the existing set of points from a Polygon. With that said, according to the javadoc: All internally-cached data relating to the old vertices are discarded. Note that...more
JSR 209 is working its way through the JCP and will add this feature.
Sun provides the Java Access Bridge for Microsoft Windows users, with programs like Monkey and Ferret to see how well you've designed your graphical programs to take advantage of assistive technol...more
I'm using setComponentZOrder() to have overlapping components but the last component I click on is always drawn on top. How do I fix this?
When components overlap, be sure their container returns false from the isOptimizedDrawingEnabled() method that is inherited from JComponent. This ensures that lower z-order components are not dra...more
How can I control the Z-order that my overlapping components are drawn in?
To understand z-order, think first of x and y positioning. The x-y coordinate space places position (0, 0) at the top-left corner of the screen. Increasing the x value moves the position to the ri...more