AWT Section Index | Page 21
If you add components to an Applet or JApplet, they will appear in the web page's assigned spot for the applet. If you create a new Frame, Window, or Dialog (or their Swing equivalents), they will...more
When you create a dialog, you must pass it the parent Frame. This Frame can be obtained via the Dialog's getParent() method. We'll define a subclass of Dialog called CenterableDialog that will loo...more
The 1.3 Java release includes a Robot class to generate low-level native mouse / keyboard input events at the operating system level. The other alternative is to call postEvent() of the EventQueu...more
See Effective Layout Management at the Java Developer Connection.
The short answer is no. The libraries are part of the standard Java 2 platform release (starting with version 1.2). Since they modify core classes in the java.awt.* libraries, you can not pull the...more
This capability is currently not supported.
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 get rid of the Unsigned Java Applet Window message at the bottom of windows/frames I create in my applet?
This is a security feature to prevent untrusted applets from displaying what appear like trusted windows. If you sign your applet and the user trusts you, the message will go away.
When you register an event handler, you must pass it an instance of some class that implements its listener interface. Simple Event Handler Start with a simple example. Suppose we want to print "...more
Swing provides a component called JTabbedPane that is rather good. If you cannot (or don't want to) use Swing for some reason, there are several ways to do this. The most common one is to create...more
The setIconImage() method of the Frame class permits you to alter the icon displayed. Image image = ...; aFrame.setIconImage(image); See How do I display an Image in an Applet or Application? f...more
Without resorting to native code, you cannot do this.
The createCustomCursor() method of the Toolkit class provides for the ability to create a cursor out of an Image. When creating custom cursors, be sure to take advantage of the hints available fro...more
Each pixel is stored as a 32 bit integer (int). The int packs four unsigned bytes within it, one for each of the alpha, red, green, and blue (ARGB) color planes, in that order. Alph...more
Short answer: you can't. The browser defines a fixed-sized area in the web page for the Applet. If you need dynamic sizing, your only choice is to have your Applet display a Frame, Window, or Dia...more