Swing Section Index
If I want to manually size my icon for the system tray, how do I find out the correct size for the platform?
The getTrayIconSize() method of SystemTray will return the appropriate Dimension for the icon. This allows you to either pick the most appropriate size from available icons or generate an icon of ...more
How do I show a popup message over a system tray icon/application?
The displayMessage() method of TrayIcon allows you to show a timed message, if supported on the platform.
How do I place a tooltip over a system tray icon?
The TrayIcon class offers a setToolTip() method to provide a string for the message.
How can I show a progress bar while reading a file?
Here's a simple example of monitoring file read progress
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.FileInputStream;
impo...more
What is the difference between a Frame and a JFrame?
Frame is part of java.awt package and exists since JDK1.0. JFrame is part of javax.swing package and exists since JDK1.1.3 or something.
Frame extends Window.
JFrame extends Frame.
You can di...more
When I display HTML in a JEditorPane, does it support JavaScript?
No.
How do I select a row (or rows) in a JTable?
In the Model-View-Controller (MVC) world of Swing, the JTable
is just a display mechanism. Instead of selecting rows in the table (view), you select rows in the selection model:
ListSelectionMode...more
What is a peer?
AWT uses native code (code specific to a single operating system) to display its components. Each implementation of the Jave Runtime Environment (JRE) must provide native implementations of Button...more
How can I highlight some text in an inactive textfield?
Here is a sample for you.
import javax.swing.*;
import java.awt.*;
import javax.swing.text.*;
public class TpHighlight extends JFrame {
String tf_str="Hello this is a demo for High Lighting...more
SSN Validation Are there any guides to validating social security numbers?
The first three digits of an SSN map to the location where the number was requested. The Social Security Administration maintains a list of valid digit mappings at http://www.ssa.gov/foia/stateweb...more
How can I provide word completion functionality in a JComboBox? (When the user enters characters then the closest matching item should be selected)
How can I provide word completion functionality in a JComboBox?
(When the user enters characters then the closest matching item should be selected)
Where can I learn (more) about dealing with 2D (two dimensional) and 3D (three dimensional) images, sound, speech, telelphony, and the rest of Java's support for advanced media handling?
Where can I learn (more) about dealing with 2D (two dimensional) and 3D
(three dimensional) images, sound, speech, telelphony, and the rest of
Java's support for advanced media handling?
Where can I learn (more) about Java's suport for internationalization (I18N)?
Check out the jGuru I18N FAQ.
Where can I learn (more) about Java's AWT (Abstract Window Toolkit)?
Check out the jGuru AWT FAQ.
How do I specify the popup menu to show for an application on the system tray?
When you create the TrayIcon for the SystemTray, you specify the PopupMenu.
TrayIcon trayIcon = new TrayIcon(anImage, "Tooltip", aPopupMenu);
Just don't forget to fill it with MenuItem objects.
more