0% found this document useful (0 votes)
19 views1 page

Algo 6

The document outlines a Java program to create a graphical user interface (GUI) frame named 'list6' containing four text fields for name, street, city, and pin code, along with a button labeled 'My details'. When the button is clicked, it populates the text fields with corresponding values. The algorithm includes steps for creating the frame, adding components, handling events, and compiling the code into an HTML applet for execution.

Uploaded by

mmabishek4
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)
19 views1 page

Algo 6

The document outlines a Java program to create a graphical user interface (GUI) frame named 'list6' containing four text fields for name, street, city, and pin code, along with a button labeled 'My details'. When the button is clicked, it populates the text fields with corresponding values. The algorithm includes steps for creating the frame, adding components, handling events, and compiling the code into an HTML applet for execution.

Uploaded by

mmabishek4
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
You are on page 1/ 1

6.

Write a Java Program to create a frame with four text fields name, street, city and pin code
with suitable tables. Also add a button called my details. When the button is clicked its
corresponding values are to be appeared in the text fields.

Algorithm:

Aim: Creation of a frame with four text fields name, street, city and pin code with suitable tables
and adding a button called my details. When clicking the button its corresponding values are
to be appeared in respective text fields.

Step No. Instructions


1 Start
2 Create an Frame called “list6” by
a) Inheriting the Frame class
b) Implementing the Interface namely WindowsListener and ActionListener
4 Create 4 text fields namely, tname, tstreet, tcity and tpin using TextField( ) function
5 Create 4 labels namely, lname, lstreet, lcity and lpin using Label( ) function
6 Add all the labels and textfields in the Frame using add( ) fucntion
7 Create a button called Mydet
8 Use addActionListener( ) function for the button
9 Catch the Action Event for button using getSource( ) function and set the texts for
each text field using setText( ) function
Catch the Window Events for window opearations using windowDeiconified( ),
windowIconified( ), windowOpened( ), windowActivated( ) and
windowDeactivated() functions
10 Save the Frame code in the name of list6.java
11 Compile the Applet code using javac
12 Create a HTML code with <APPLET> tag with its CODE attribute as list6.class
13 Save the HTML code as list6.html
14 Run the HTML code using appletviewer
15 Stop

You might also like