Client-Side Development Section Index | Page 5
Player player = Manager.createPlayer("http://example.com/example.midi"); player.start();
Use the setLoopCount() method of Player to playback media with looping. A value of -1 means forever. A value of 1 is the default. 0 is invalid.more
This is similar to playing an audio file but requires you to get the control to display the video on. You need to see the results, not just hear them. InputStream is = getClass().getResourceAsStr...more
In JDK 6.0, jrunscript is a command-line scripting shell program. Supposedly, it is experimental and may not survive past JDK 6.0.
With Java 6, prior to the main window of the application showing, you can get the splash screen via SplashScreen splash = SplashScreen.getSplashScreen();, get its graphics context, and draw to it ...more
You need to specify the splash image in the manifest file for the jar: Manifest-Version: 1.0 Main-Class: HelloSplash SplashScreen-Image: MyImage.png Then run the JAR without specifying t...more
With JDK 6.0, there is a -splash option for java, as in java -splash:Hello.png HelloWorld.
The JComponent class of the javax.swing package serves as the base class.
Prior to Java 6, you couldn't. With Java 6, there is a new setTabComponentAt() method of JTabbedPane.
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
Added to JDK 6, you call the print() method of JTextComponent to do this. Prior versions required you to paginate things yourself.
Short answer: EventQueue. Longer answer... Utility methods were added to the SwingUtilities class because the first version of the Swing classes had to work with JDK 1.1, even though Swing was re...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