Skip to main content

Posts

Showing posts from 2017

Swing's in java

                                   Swing   in java   Swing is the Java platform's UI -- it acts as the software to handle all the interaction between a user and the computer. It essentially serves as the middleman between the user and the guts of the computer. How exactly does Swing do this? It provides mechanisms to handle the UI aspects described in the previous panel: • Keyboard: Swing provides a way to capture user input. • Colors: Swing provides a way to change the colors you see on the screen. • The address bar you type into: Swing provides text components that handle all the   mundane tasks. • The volume of the music: Well ... Swing's not perfect. In any case, Swing gives you all the tools you need to create your own UI. Swing library is an official Java GUI tool...

Use of font class in awt Java

                        Use of font class import java.applet.*; import java.awt.*; /*             <applet code="FontDemo" height=400 width=400>             </applet> */ public class FontDemo extends Applet {             public void paint(Graphics g)             {                         String fname="Roman";                         int type=Font.PLA...

Use of image, font class in awt in java

     Use of image class and font class in mouse  click awt , java Image class is used for handling the images or plotting the images on the applet. Method of Image class : getImage( ) :                         This method is used for obtaining the image reference .                         The general form is ,                                     Image getImage(getCodeBase( ) , "image Name") getCodeBase() :             get the object which will display the ima...

Mouse click example 1

                         Mouse click example Q. Write a Java program to define an applet , which will contain a label and when we click on the applet , the message will appear on the label. import java.applet.*; import java.awt.*; import java.awt.event.*; /*             <applet code="MouseDemo1" height=200 width=200>             </applet> */ public class MouseDemo1 extends Applet implements MouseListener {             Label lbl;             public void init( )             {    ...

Mouse event in Java

                     Mouse event in awt  Mouse The Mouse is handled using the listener known as the MouseListener. The MouseListener provides the various methods for handling the mouse events . 1. mousePressed( ) :             This method is called when the mouse is pressed . The general form is ,                         public void mousePressed(MouseEvent me)                         {                         //body of the method.  ...