AWT Section Index
How can I save Frame graphics as jpeg image?
The basic idea is to print the GUI to an offscreen image, then encode that image as a JPEG.
import sun.awt.image.codec.JPEGImageEncoderImpl;
import java.io.ByteArrayOutputStream;
import java.aw...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
What causes the error "Can't connect to X11 window server"?
The Sun AWT classes on Unix and Linux have a dependence on the X Window System: when you use the classes, they expect to load X client libraries and be able to talk to an X display server. This ma...more
Is there any way to generate offscreen images without relying on the native graphics support? I'd like to create an image without an X server running, or create an image with more colors than the current video mode.
You must have a graphical environment installed on your server to work with Java image routines in AWT, even though the image will only be displayed on the client's machine.
The AWT image manipul...more
How and why would you use the java.awt.EventQueue?
Well there are many reasons.
Say, you wanted to catch all the mouse events across all the GUI of your application.
Without tapping the EventQueue you will have to add a mouse listener
and mouse...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 do I create an image (GIF, JPEG, etc.) on the fly from a servlet?
To create an image or do image processing from Java, there are several
packages and classes available. See the Purple Servlet References for a list.
Once you have an image file in your servlet...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
Why doesn't the Windows L&F use the same Fonts as Windows?
Why doesn't the Windows L&F use the same Fonts as Windows?
Why don't they just use the SAME? I know they do try to follow the Windows settings (even more in 1.4!) But, still, the fonts (the mos...more
Ensuring that previous graphical objects do not get erased with every repaint I'm trying to create a MS-Paint Style whiteboard for collaborative work across the net.
Ensuring that previous graphical objects do not get erased with every repaint
I'm trying to create a MS-Paint Style whiteboard for collaborative work
across the net.
Any previously drawn graphical...more
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?
When dropping an object over a JTree, how do you determine the node being dropped over?
The importData() method of your TransferHandler has a TransferSupport argument. From this support object, you can ask for the drop location with getDropLocation(). This returns an implementation o...more
When having a droppable JTree, how do I change the default behavior of using selection to see the active drop target?
JTree has a setDropMode() method to change the default setting of USE_SELECTION. Other valid modes are ON, INSERT, and ON_OR_INSERT. ON lets you drop something onto another node. INSERT is for bet...more
What accessible roles were added to the 1.4 J2SE accessibility API?
Class AccessibleRole Added the following constants:
DATE_EDITOR
FONT_CHOOSER
GROUP_BOX
SPIN_BOX
STATUS_BAR
How can I find out if my application is being used with a screen magnifier?
The javax.accessibility.screen_magnifier_present property is available. When true, the magnifier is present, and your application can be altered accordingly.