New Member FAQ
|
Forums
|
Earn Revenue
Resources
Entrance
Ask Experts
Exam Papers
Jobs
English
Projects
Universities
Colleges
Courses
Schools
Training
My India
Members
|
Communities
|
Business Directory
|
Classifieds
|
Reviews
|
Silverlight Games
|
Peer Appraisal
|
Bookmarks
|
Polls
|
Mentors
|
Links
|
B.Tech Projects
|
Lobby
|
Gift Shop
|
Chat
My Profile
Sign In
Register
AdSense Revenue
Active Members
Today
Mr. Anindya
(308)
MVR PURNA ...
(220)
gomathi
(135)
Last 7 Days
PROSENJIT MANN...
(1994)
Mr. Anindya
(1539)
Aira
(1426)
more...
Awards & Gifts
Online Exams
Aptitude Questions
General Aptitude Tests
Medical Entrance
Engineering Entrance
Bank Tests
TOEFL & IELTS Questions
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.
Resources
»
Articles/Knowledge Sharing
»
Education
»
Program to Handle Java Button class
Posted Date: 09 Dec 2008
Resource Type:
Articles/Knowledge Sharing
Category:
Education
Author:
uday kiran
Member Level:
Silver
Rating:
Points
: 2
/*Program for Handling Buttons*/
Aim: We will handle the Button Class provided by the java.awt package and the operations on Buttons
import java.awt.*;
import java.awt.event.*;
public class HandlingButtons extends Frame implements ActionListener
{
Button b1 = new Button("Hide");
Button b2 = new Button("Exit");
Label l = new Label();
public HandlingButtons()
{
super("Handling Buttons");
setSize(500,700);
setLayout(new FlowLayout());
add(b1);
add(b2);
add(l);
b1.addActionListener(this);
b2.addActionListener(this);
setVisible(true);
}
public void actionPerformed(ActionEvent ae)
{
if (ae.getSource() == b1)
{
String label = b1.getLabel();
if(label.equals("Hide"))
{
b1.setLabel("Show");
b2.setVisible(false);
l.setText("you Clicked Hide Button");
}
else
{
b1.setLabel("Hide");
b2.setVisible(true);
l.setText("you Clicked Show Button");
}
}
else
{
System.exit(0);
}
}
public static void main(String args[])
{
new HandlingButtons();
}
}
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:
IAS Preliminary Exam Syllabus for Zoology
Previous Resource:
Program for Handling Java Label class
Return to Discussion Resource Index
Post New Resource
Category:
Education
Post resources and
earn money
!
More Resources
IAS Preliminary Exam Syllabus for Zoology
IAS Preliminary Exam Syllabus for Statistics
IAS Preliminary Exam Syllabus for Sociology
IAS Preliminary Exam Syllabus for Public Administration
IAS Preliminary Exam Syllabus for Psychology
IAS Preliminary Exam Syllabus for Political Science
Advertise Here
Contact Us
Advertise
Editors
Privacy Policy
Terms Of Use
ISC Technologies.
2006 - 2009 All Rights Reserved.