Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


advertisement
Search the Tips
Tip Bank > Java > Java APIs > AWT

AWT - Page 2

21-40 of 104     Previous     Next
Be User-Friendly With Double-Clicks
by Behrouz Fallahi
The idea behind the Java's handling of double-clicks on the mouse is that if the mouse is clicked fast enough for two times in the same spot, a "java.awt.event.MouseEvent" event object will be fired ...
Cursor Customization
by DevX Pro
I can set the cursor to a variety of stock cursors (e.g., HAND_CURSOR) but would like to use my own images to extend the available cursors. Is this possible?
Capturing KeyEvents
by DevX Pro
How can I capture KeyEvents in a Frame that doesn't have any TextFields or TextAreas?
Generating KeyEvents
by DevX Pro
How can I generate a Key Event from Java? I need to generate a KEY_TYPED Event, so the focused Component accepts it like normal key action.
List Selection Actions
by DevX Pro
When someone selects one item on my list, I want an input field to appear next to it. How do I do this?
Window Maximization
by DevX Pro
How do you set the maximized state of a window within code?
Window Resize Event
by DevX Pro
How can I detect that a window has been resized? I can detect events such as WindowIconified, WindowDeiconified, WindowOpening, WindowClosing, etc., but not the resize event.
Cut and Copy Text to Clipboard
by Brett Spell
Java 1.1 introduced the java.awt.datatransfer package and its associated classes, which provide the foundation for capabilities such as cut-and-paste. On the surface, the API may appear complex, ...
Build List of Components in Hierarchy
by Brett Spell
It is sometimes useful to be able to obtain a complete list of the components in a container hierarchy. A getComponents() method is provided in the java.awt.Container class, but it only returns ...
Generate Beeps in Your Application
by Brett Spell
Many applications use an audible "beep" sound to signal that an error has occurred or to get the user's attention for some reason. For example, a user interface that allows the user to enter only ...
Modifying Layout on Multiple Platforms
by Ulrik Magnusson
You can use the Toolkit's getScreenSize().width to recompute the size of a component at run time. For example, if you have a Frame that is supposed to have the screen's height, given the int umx ...
Refresh Component Displays
by Brett Spell
When you create the visual components that make up a user interface, their size and position are usually constant. However, it's sometimes necessary to change a component's size or position ...
Getting a Reference to the Parent Frame
by Brett Spell
Instances of java.awt.Dialog are often used to display error messages in an application. As a result, you may find yourself writing a component that displays a message in a Dialog when a user ...
Java Virtual Machine Doesn't Exit
by Brett Spell
You may have been surprised and frustrated to find that in some cases, the Java Virtual Machine (JVM) does not stop running when your application exits the static main() method. For ...
Specifying Position When Adding Components
by Brett Spell
The java.awt.Container class provides a number of different overloaded versions of the add() method which are used to add components to the container. The integer value specified with the ...
Dispatching Mouse Events
by DevX Pro
How can I pass or send a mousedown to a choice menu when a button is pressed?
Event Thread and Painting
by Brett Spell
Java uses the event thread to notify listeners of events by making calls to methods such as actionPerformed() and itemStateChanged(). However, this same thread is also responsible for repainting ...
TextArea With Word Wrap
by Brett Spell
The default behavior for a java.awt.TextArea is to scroll the text you enter to the left once the length of the line of text exceeds the displayable area. When this occurs, a horizontal scroll bar at ...
Determine Font Properties With FontMetrics
by Brett Spell
The java.awt.FontMetrics class provides information on the properties of a font. For example, it can be used to determine how many horizontal pixels are required (i.e., the width) when a single ...
Debug Problems in Your GridBagLayout Code
by Brett Spell
The GridBagLayout is a flexible layout manager, but is also notoriously difficult to use. Some of the most common and difficult to debug problems occur when the amount of space allocated to ...
21-40 of 104     Previous     Next
Sitemap