0% found this document useful (0 votes)
4 views2 pages

AWT Event Handling Java Programs

Uploaded by

yashhaibatpure5
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views2 pages

AWT Event Handling Java Programs

Uploaded by

yashhaibatpure5
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

1) Write a program to create a frame using AWT.

Implement mouseClicked(), mouseEntered() and


mouseExited() events. Frame should become visible when mouse enters it.
2) Using AWT, write a program to display a string in frame window with pink colour as background
3) Using AWT, write a program to create two buttons named “Red” and “Blue”. When a button is pressed the
background colour should be set to the colour named by the button’s label.
4) Using AWT, write a program which responds to KEY_TYPED event and updates the status window with
message (“Typed character is: X”). Use adapter class for other two events.
5) Using AWT, write a program to create two buttons labelled ‘A’ and ‘B’. When button ‘A’ is pressed, it
displays your personal information (Name, Course, Roll No, College) and when button ‘B’ is pressed, it
displays your CGPA in previous semester.
6) Each time you click the button, the counter's value increases by 1.

7) WAP To demonstrate the MouseEvent:

8) WAP MouseEvent and MouseMotionListener Interface


9) WAP KeyEvent and KeyListener Interface

You might also like