New Member FAQ | Forums | Earn Revenue


Resources Entrance Ask Experts Exam Papers Jobs English Projects Universities Colleges Courses Schools Training My India



My Profile
Active Members
TodayLast 7 Days more...



Awards & Gifts
Online Exams

Fresher Jobs


Our fresher job section is exclusively for fresh graduates! Find jobs for freshers in major Indian cities including Bangalore, Chennai, Hyderabad, Pune or Kochi

Resources


Find educational articles, blogs, discussion threads and other resources.

Colleges


Find details about any college in India or search for courses.

website counter



Resources » Articles/Knowledge Sharing » Education »

Program for Handling Java Label class


Posted Date: 09 Dec 2008    Resource Type: Articles/Knowledge Sharing    Category: Education
Author: uday kiranMember Level: Silver    
Rating: 3 out of 53 out of 53 out of 5Points: 2



/*Handling Labels*/
Aim: We will handle the Labels using Label Class and operations on Labels provided by the java.awt package.


import java.awt.*;
import java.awt.event.*;

public class HandlingLabels extends Frame implements MouseListener
{
Label l1 = new Label("First");
Label l2 = new Label("Second");

public HandlingLabels()
{
super("Handling Labels");
setSize(200,300);
setLayout(new FlowLayout());
add(l1);
add(l2);
l1.addMouseListener(this);
l2.addMouseListener(this);
setVisible(true);
}

public void mousePressed(MouseEvent me) { }

public void mouseClicked(MouseEvent me) { }

public void mouseReleased(MouseEvent me) { }

public void mouseEntered(MouseEvent me)
{
if(me.getSource() == l1)
l1.setText("On Me");
else
l2.setText("On Me");
}

public void mouseExited(MouseEvent me)
{
if(me.getSource() == l1)
l1.setText("First");
else
l2.setText("Second");
}

public static void main(String args[])
{
new HandlingLabels();
}
}





Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Sign In to add tags.
Java Programs  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Program to Handle Java Button class
Previous Resource: Terms used in Share Market
Return to Discussion Resource Index
Post New Resource
Category: Education


Post resources and earn money!
 
More Resources



Advertise Here





Contact Us   Advertise   Editors    Privacy Policy    Terms Of Use   

ISC Technologies.
2006 - 2009 All Rights Reserved.