by Dinesh Thakur Category: AWT and Applets

There are four different overloaded drawImage methods in Graphics.

First, we'll show you the least complicated call:

if (image != null) {
   g.drawImage (image,xloc,yloc, this) ;
}
 
by Dinesh Thakur Category: AWT and Applets

The Java AWT provides several classes to manage loading and displaying images. The most common image code you see on the Web is called an animator. There are numerous animation applets and classes available on the WWW. The Java Developer's Kit provides a set of demo applications that draw images using static, single-buffered, and double-buffered animation.

 
by Dinesh Thakur Category: AWT and Applets

When you override the Container.insets () method, you are instructing the AWT to provide a margin around your container. The inset is used mostly by the Layout Manager to calculate sizing and positioning for contained objects. The Layout Manager will fit everything inside the insets you provide to it. The most common use of the inset space is to provide white space around a set of components to make them stand out as a group or just to provide more pleasing balance to a window.Remember that the insets indicate the distance from the border of the container to the contained objects. Effectively, you are setting the margins for your container. The space between the top, left, right, and bottom inset and the border of the container would be considered the margin.

 
by Dinesh Thakur Category: AWT and Applets

The AudioClip class is used to load and play sound files. To load a sound file the getAudioClip () Method of the AudioClip class is used. The general form of the getAudioClip () method is

 
by Dinesh Thakur Category: AWT and Applets

A rectangle can be drawn by using the drawRect () method. This method also takes the four parameters.

 
by Dinesh Thakur Category: AWT and Applets

Java allows the applet to transfer the control to another URL by using the showDocument () Method defined in the AppletContext interface. For this, first of all, it is needed to obtain the Context of the currently executing applet by calling the getAppletContext () method defined by the Applet. Once the context of the applet is obtained with in an applet, another document can be brought into view by calling showDocument () method.

 
by Dinesh Thakur Category: AWT and Applets

In Java, an event is an object which specifies the change of state in the source. It is generated whenever an action takes place like a mouse button is clicked or text is modified. Java's AWT (Abstract Window Toolkit) is responsible for communicating these actions between the program and the user. Java packages such as java. util, java. awt, java. awt. event and javax. swing support event handling mechanism.



 
by Dinesh Thakur Category: AWT and Applets

The AWT allows us to use various graphical components. When we start writing any applet program we essentially import two packages namely - java.awt and java.applet.



 
by Dinesh Thakur Category: AWT and Applets

The Graphics class provides different methods for drawing shapes such as lines, rectangles and ovals. Table shows the methods that are used to draw shapes. Each drawing method takes.

 
by Dinesh Thakur Category: AWT and Applets

The Abstract Windowing Toolkit (AWT) is the first set of nontrivial, publicly available, basic objects with which to build Java programs, with the focus on graphical user interfaces, or GUls. The AWT was built by Sun's JavaSoft unit and is provided free for anyone to use for any reason whatsoever, in binary form. There is some controversy as to whether the AWT in its present condition will survive, but it does have three things going for it:

 
by Dinesh Thakur Category: AWT and Applets

The APPLET tag of HTML is used to start an applet either from a web browser or an applet viewer. The HTML tag allows a Java applet to be embedded in an HTML document.

 
by Dinesh Thakur Category: AWT and Applets

Applets can be executed in two ways: from Browser or from Appletviewer. The JDK provides the Appletviewer utility.

 
by Dinesh Thakur Category: AWT and Applets

Java programs consist of applications and applets. Java applications are stand-alone programs and typically executed using the Java interpreter. On the other hand, Java applets are executed in a web browser or in a special window known as the Appletviewer; however, the compilation stages of both are the same.

 
by Dinesh Thakur Category: AWT and Applets
 
by Dinesh Thakur Category: AWT and Applets

When a component receives focus, ie, is the element of the screen that is active FocusEvent type events occur. 

To make an object can listen to events FocusEvent FocusListener type must implement the interface, and it must be added as to the method FocusListener

 
by Dinesh Thakur Category: AWT and Applets

The AWT provides java.awt.TextField class through the component box input text or just text box. This component enables the editing and input a single line of text in a very convenient way for the user.Hence, this control is called editable control. Any data entered through this component is treated primarily as text, should be explicitly converted to another type if desired.



 
by Dinesh Thakur Category: AWT and Applets

The java.awt.MediaTracker class is a useful class.It can monitor the progress of any number of images, so you can expect to all images are loaded or to be loaded only specific. Furthermore, can check for errors. The constructor is: public MediaTracker (Component comp) This constructor creates a new MediaTracker for pictures to be displayed in the variable comp, but really this parameter is not particularly important. 



 
by Dinesh Thakur Category: AWT and Applets
 
by Dinesh Thakur Category: AWT and Applets

 The Image class is used to load and display images. To load an image the getimage ()method of the Image class is used and to display the image the draw Image ()method of the Graphics class is used.

 

Page 1 of 6



About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.C.A, MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. For any type of query or something that you think is missing, please feel free to Contact us.



Related Articles