124 Study  (Free Education Portal) Indian Free E-Learning Platform
  • Home
  • 124 IELTS
  • AMAN IELTS
  • iEnglish Guru
  • Books
  • Support Us
  • Contact Us

Sunday, September 20, 2020

Write any code for event handling in Java Programming? by Ranjot Singh

September 20, 2020  BCA, BCA-6th Sem, Java  No comments

 



Answer. import java.awt.*;

import java.awt.event.*;

class  EventHandle extends Frame implements ActionListener{

TextField textField;

EventHandle()

{

textField = new TextField();

textField.setBounds(60,50,170,20);

Button button = new Button("Quote");

button.setBounds(90,140,75,40);

//1

button.addActionListener(this);

add(button);

add(textField);

setSize(250,250);

setLayout(null);

setVisible(true);

}

//2

public void actionPerformed(ActionEvent e){

textField.setText("Keep Learning");

}

public static void main(String args[]){

new EventHandle();

}

}

Email ThisBlogThis!Share to XShare to Facebook
Newer Post Older Post Home

0 comments:

Post a Comment

Social Profiles

TwitterFacebookGoogle PlusLinkedInRSS FeedEmail
  • 124 IELTS
  • Submission
  • Interest Calculator
  • Games Portal
  • Universities

Categories

Academic Task 2 BCA Question Answer BCA-3rd Sem Reading Test Question Paper IELTS Ebook Academic Task 1 BCA-6th Sem Computer Networks BCA-5th Sem Books C++ MIS Our Products Java Education HTML Speaking BCA English Software Engineering Punjabi Tips & Techniques Other Material GT Writing General Reading Notes BCA-1st Sem CELPIP Library ASP.NET BCA-4th Sem E-Commerce GK Grammar Prediction book B.Tech B.com BBA Free Ebooks Google MBA MCA PTU PU CHD Syllabus System Software offers Academic Task 2 VOCAB B.A CBSC Date Sheet Delhi University English Grammar Free Books ICSE LINKING WORDS Learn Punjabi Microsoft Mock Test News P.HD Press Release
  • Popular
  • Tags
  • Blog Archives
  • ROBERT ANTHONY’S HIERARCHY OF MANAGEMENT ACTIVITY by 124study
  • SYNONYMS FOR "NICE", "GOOD", "BAD" & "SAD" by 124Study
  • Some people think that instead of preventing climate change, we need to find a way to live with it. To what extent do you agree or disagree? || AMAN IELTS IELTS IELTS IELTS IELTS

 
Copyright © 124 Study (Free Education Portal) Indian Free E-Learning Platform | Created by Ranjot Singh Chahal