You are on page 1of 23

UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA

FACULTY OF TELECOMMUNICATION AND INFORMATION


ENGINEERING COMPUTER ENGINEERING DEPARTMENT

Object Orienting Programming


(Java)

Lab Manual No 06

Dated:
3 Feb, 2024 to 26th Feb, 2024
Semester:
2024

Lab Instructor: SHEHARYAR KHAN Page 1

68 | P a g e
UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA
FACULTY OF TELECOMMUNICATION AND INFORMATION
ENGINEERING COMPUTER ENGINEERING DEPARTMENT

Introduction to Swing:

Swing API is a set of extensible GUI Components to ease the developer's life to create JAVA based Front End/GUI
Applications. It is built on top of AWT API and acts as a replacement of AWT API, since it has almost every control
corresponding to AWT controls. Swing component follows a Model-View-Controller architecture to fulfill the following
criteria’s.

• A single API is to be sufficient to support multiple look and feel.

• API is to be model driven so that the highest level API is not required to have data.

• API is to use the Java Bean model so that Builder Tools and IDE can provide better services to the
developers for use.

Swing Features:

• Light Weight − Swing components are independent of native Operating System's API as Swing API
controls are rendered mostly using pure JAVA code instead of underlying operating system calls.

• Rich Controls − Swing provides a rich set of advanced controls like Tree, TabbedPane, slider, colorpicker,
and table controls.

• Highly Customizable − Swing controls can be customized in a very easy way as visual apperance is
independent of internal representation.

• Pluggable look-and-feel − SWING based GUI Application look and feel can be changed at run-time, based
on available values

Lab Instructor: SHEHARYAR KHAN Page 2

69 | P a g e
UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA
FACULTY OF TELECOMMUNICATION AND INFORMATION
ENGINEERING COMPUTER ENGINEERING DEPARTMENT

SWING – Controls:
Every user interface considers the following three main aspects −

• UI Elements − These are the core visual elements the user eventually sees and interacts with.
GWT(Google Web Toolkit) provides a huge list of widely used and common elements varying from basic to
complex, which we will cover in this Lab Manual.

• Layouts − They define how UI elements should be organized on the screen and provide a final look and
feel to the GUI (Graphical User Interface). This part will be covered in the Layout Lab Manual.

• Behavior − These are the events which occur when the user interacts with UI elements. This part will be
covered in the Event Handling Lab Manual.

Every SWING controls inherits properties from the following Component class hierarchy.

Lab Instructor: SHEHARYAR KHAN Page 3

70 | P a g e
UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA
FACULTY OF TELECOMMUNICATION AND INFORMATION
ENGINEERING COMPUTER ENGINEERING DEPARTMENT

S.No. Class & Description

Component

1 A Component is the abstract base class for the non menu user-interface controls of SWING.
Component represents an object with graphical representation

Container

2 A Container is a component that can contain other SWING components

JComponent

A JComponent is a base class for all SWING UI components. In order to use a SWING
3 component that inherits from JComponent, the component must be in a containment hierarchy

whose root is a top-level SWING container

SWING UI Elements:
Following is the list of commonly used controls while designing GUI using SWING.

S.No. Class & Description

JLabel
1

A JLabel object is a component for placing text in a container.

JButton
2 This class creates a labeled button.

JColorChooser

3 A JColorChooser provides a pane of controls designed to allow a user to manipulate and select a
color.

Lab Instructor: SHEHARYAR KHAN Page 4

71 | P a g e
UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA
FACULTY OF TELECOMMUNICATION AND INFORMATION
ENGINEERING COMPUTER ENGINEERING DEPARTMENT

JCheck Box
4 A JCheckBox is a graphical component that can be in either an on(true) or off (false) state.

JRadioButton
The JRadioButton class is a graphical component that can be in either an on (true) or off (false)
5
state. in a group.

JList
6 A JList component presents the user with a scrolling list of text items.

JComboBox
7 A JComboBox component presents the user with a to show up menu of choices.

JTextField
8 A JTextField object is a text component that allows for the editing of a single line of text.

JPasswordField
9 A JPasswordField object is a text component specialized for password entry.

JTextArea
10 A JTextArea object is a text component that allows editing of a multiple lines of text.

ImageIcon
11 A ImageIcon control is an implementation of the Icon interface that paints Icons from Images

JScrollbar
A Scrollbar control represents a scroll bar component in order to enable the user to select from
12
range of values.

JOptionPane
13
JOptionPane provides set of standard dialog boxes that prompt users for a value or informs them

Lab Instructor: SHEHARYAR KHAN Page 5

72 | P a g e
UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA
FACULTY OF TELECOMMUNICATION AND INFORMATION
ENGINEERING COMPUTER ENGINEERING DEPARTMENT

of something.

JFileChooser
14 A JFileChooser control represents a dialog window from which the user can select a file.

JProgressBar
As the task progresses towards completion, the progress bar displays the task's percentage of
15
completion.

JSlider
16 A JSlider lets the user graphically select a value by sliding a knob within a bounded interval.

JSpinner
A JSpinner is a single line input field that lets the user select a number or an object value from an
17
ordered sequence.

Using Top-Level Containers:

Swing provides three generally useful top-level container classes: JFrame, JDialog, and JApplet. When using these
classes, you should keep these facts in mind:

• To appear onscreen, every GUI component must be part of a containment hierarchy. A containment
hierarchy is a tree of components that has a top-level container as its root. We'll show you one in a bit.
• Each GUI component can be contained only once. If a component is already in a container and you try to
add it to another container, the component will be removed from the first container and then added to the
second.
• Each top-level container has a content pane that, generally speaking, contains (directly or indirectly)
the visible components in that top-level container's GUI.
• You can optionally add a menu bar to a top-level container. The menu bar is by convention positioned within
the top-level container, but outside the content pane. Some look and feels, such as the Mac OS look and
feel, give you the option of placing the menu bar in another place more appropriate for the look and feel,
such as at the top of the screen.

Lab Instructor: SHEHARYAR KHAN Page 6

73 | P a g e
UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA
FACULTY OF TELECOMMUNICATION AND INFORMATION
ENGINEERING COMPUTER ENGINEERING DEPARTMENT

JFRAME Example No 1:

import javax.swing.*;

public class JFRAMEEXAMPLE {

public static void main(String[] args) {


// TODO Auto-generated method stub
JFrame f=new JFrame("Title of Window");

f.setSize(400,400); // Size of window


f.setLayout(null);
f.setVisible(true);
}

Lab Instructor: SHEHARYAR KHAN Page 7

74 | P a g e
UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA
FACULTY OF TELECOMMUNICATION AND INFORMATION
ENGINEERING COMPUTER ENGINEERING DEPARTMENT

JButton Example No 02:

import javax.swing.*;

public class JavaButtonExample {


public static void main(String[] args) {
// TODO Auto-generated method stub
JFrame f=new JFrame("Button Example");
JButton b=new JButton("Click Here");
b.setBounds(50,100,90,100); // x axis ,y axis width height of Button
f.add(b); // adding Button to Jframe
f.setSize(400,400); // Window width and Height
f.setLayout(null);
f.setVisible(true);
}

JLabel Example No 03:

import javax.swing.*;
public class JLabelExample {

public static void main(String[] args) {


// TODO Auto-generated method stub
JFrame f= new JFrame("Label Example");
JLabel l1,l2;
l1=new JLabel("First Label.");
l1.setBounds(50,50, 100,30);
l2=new JLabel("Second Label.");
l2.setBounds(50,100, 100,30);
f.add(l1); f.add(l2);
f.setSize(300,300);
f.setLayout(null);
f.setVisible(true);
}

Lab Instructor: SHEHARYAR KHAN Page 8

75 | P a g e
UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA
FACULTY OF TELECOMMUNICATION AND INFORMATION
ENGINEERING COMPUTER ENGINEERING DEPARTMENT

JTextField Example No 04:

import javax.swing.*;
public class JTextFieldExample {

public static void main(String[] args) {


// TODO Auto-generated method stub
JFrame f= new JFrame("TextField Example");
JTextField t1,t2;
t1=new JTextField("Welcome to Java Course.");
t1.setBounds(50,100, 200,30);
t2=new JTextField("Swing Lab Manual");
t2.setBounds(50,150, 200,30);
f.add(t1); f.add(t2);
f.setSize(400,400);
f.setLayout(null);
f.setVisible(true);
}

JTextArea Example No 05:

import javax.swing.*;
public class JTextAreaExample {

public static void main(String[] args) {


// TODO Auto-generated method stub
JFrame f= new JFrame();
JTextArea area=new JTextArea("Welcome to Text Area
Example"); area.setBounds(10,30, 200,200); f.add(area);

f.setSize(300,300);
f.setLayout(null);
f.setVisible(true);
}

Lab Instructor: SHEHARYAR KHAN Page 9

76 | P a g e
UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA
FACULTY OF TELECOMMUNICATION AND INFORMATION
ENGINEERING COMPUTER ENGINEERING DEPARTMENT

JPasswordField Example No 06:

import javax.swing.*;
public class PasswordFieldExample {
public static void main(String[] args) {
JFrame f=new JFrame("Password Field Example");
JPasswordField value = new JPasswordField();
JLabel l1=new JLabel("Password:");
l1.setBounds(20,100, 80,30);
value.setBounds(100,100,100,30);
f.add(value); f.add(l1);
f.setSize(300,300);
f.setLayout(null);
f.setVisible(true); }
}

JCheckBox Example No 07:

import javax.swing.*;
public class CheckBoxExample {

public static void main(String[] args) {


// TODO Auto-generated method stub
JFrame f= new JFrame("CheckBox Example");
JCheckBox checkBox1 = new JCheckBox("C++");
checkBox1.setBounds(100,100, 50,50);
JCheckBox checkBox2 = new JCheckBox("Java", true);
checkBox2.setBounds(100,150, 90,50);
f.add(checkBox1);
f.add(checkBox2);
f.setSize(400,400);
f.setLayout(null);
f.setVisible(true);
}

Lab Instructor: SHEHARYAR KHAN Page 10

77 | P a g e
UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA
FACULTY OF TELECOMMUNICATION AND INFORMATION
ENGINEERING COMPUTER ENGINEERING DEPARTMENT

JRadioButton Example No 08:

import javax.swing.*;
public class RadioButtonExample {

public static void main(String[] args) {


// TODO Auto-generated method stub
JFrame f=new JFrame();
JRadioButton r1=new JRadioButton("A) Male");
JRadioButton r2=new JRadioButton("B) Female");
r1.setBounds(75,50,100,30);
r2.setBounds(75,100,100,30);
ButtonGroup bg=new ButtonGroup();
bg.add(r1);bg.add(r2);
f.add(r1);f.add(r2);
f.setSize(300,300);
f.setLayout(null);
f.setVisible(true);
}

JComboBox Example No 09:

import javax.swing.*;
public class JComboBoxExample {
public static void main(String[] args) {
JFrame f=new JFrame("ComboBox Example");
String country[]={"Pak","Aus","U.S.A","England","Newzealand"};
JComboBox cb=new JComboBox(country);
cb.setBounds(50, 50,90,20);
f.add(cb);
f.setLayout(null);
f.setSize(400,500);
f.setVisible(true);
}
}

Lab Instructor: SHEHARYAR KHAN Page 11

78 | P a g e
UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA
FACULTY OF TELECOMMUNICATION AND INFORMATION
ENGINEERING COMPUTER ENGINEERING DEPARTMENT

JTable Example No 10:

import javax.swing.*;
public class JTableExample {

public static void main(String[] args) {


//TODO Auto-generated method stub
JFrame f=new JFrame();
String data[][]={ {"101","shery","670000"},
{"102","Aamir","780000"},
{"101","imran","700000"}};
String column[]={"ID","NAME","SALARY"};
JTable jt=new JTable(data,column);
jt.setBounds(30,40,200,300);
JScrollPane sp=new JScrollPane(jt);
f.add(sp);
f.setSize(300,400);
f.setVisible(true);
}

JList Example No 11:

import javax.swing.*;
public class JListExample {

public static void main(String[] args) {


// TODO Auto-generated method stub
JFrame f= new JFrame();
DefaultListModel<String> l1 = new DefaultListModel<>();
l1.addElement("Item1");
l1.addElement("Item2");
l1.addElement("Item3");
l1.addElement("Item4");
JList<String> list = new JList<>(l1);
list.setBounds(100,100, 75,75);
f.add(list);
f.setSize(400,400);
f.setLayout(null);
f.setVisible(true);
}

Lab Instructor: SHEHARYAR KHAN Page 12

79 | P a g e
UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA
FACULTY OF TELECOMMUNICATION AND INFORMATION
ENGINEERING COMPUTER ENGINEERING DEPARTMENT

JOption Example No 12:

import javax.swing.*;
public class JOptionExample {

public static void main(String[] args) {


// TODO Auto-generated method
stub JFrame f=new JFrame();
JOptionPane.showMessageDialog(f,"Hello, Welcome to Uet Taxila.");
}
}

import javax.swing.*;

public class JoptionInputExample {


public static void main(String[] args) {
JFrame frame = new JFrame("InputDialog Example #12");

String name = JOptionPane.showInputDialog(frame, "What's your name?");

System.out.printf("The user's name is '%s'.\n", name);

JScrollBar Example No 13:

import javax.swing.*;
public class JScrollBarExample {

public static void main(String[] args) {


// TODO Auto-generated method stub
JFrame f= new JFrame("Scrollbar Example");
JScrollBar s=new JScrollBar();
s.setBounds(100,100, 50,100);
f.add(s);
f.setSize(400,400);
f.setLayout(null);
f.setVisible(true);
}

Lab Instructor: SHEHARYAR KHAN Page 13

80 | P a g e
UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA
FACULTY OF TELECOMMUNICATION AND INFORMATION
ENGINEERING COMPUTER ENGINEERING DEPARTMENT

JMenuItem Example No 13:

import javax.swing.*;
public class JMenuExample {

public static void main(String[] args) {


// TODO Auto-generated method stub
JMenu menu, submenu=new JMenu();
JMenuItem i1, i2, i3, i4, i5;

JFrame f= new JFrame("Menu and MenuItem Example");


JMenuBar mb=new JMenuBar();
menu=new JMenu("Menu");
submenu=new JMenu("Sub Menu");
i1=new JMenuItem("Item 1");
i2=new JMenuItem("Item 2");
i3=new JMenuItem("Item 3");
i4=new JMenuItem("Item 4");
i5=new JMenuItem("Item 5");
menu.add(i1); menu.add(i2); menu.add(i3);
submenu.add(i4); submenu.add(i5);
menu.add(submenu);
mb.add(menu);
f.setJMenuBar(mb);
f.setSize(400,400);
f.setLayout(null);
f.setVisible(true);
}

Lab Instructor: SHEHARYAR KHAN Page 14

81 | P a g e
UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA
FACULTY OF TELECOMMUNICATION AND INFORMATION
ENGINEERING COMPUTER ENGINEERING DEPARTMENT

JPanel Example No 14:


import java.awt.Color;

import javax.swing.*;
public class JpanelExample {

public static void main(String[] args) {


// TODO Auto-generated method stub
JFrame f= new JFrame("Panel Example");
JPanel panel=new JPanel();
panel.setBounds(40,80,200,200);
panel.setBackground(Color.gray);
JButton b1=new JButton("Button 1");
b1.setBounds(50,100,80,30);
b1.setBackground(Color.yellow);
JButton b2=new JButton("Button 2");
b2.setBounds(100,100,80,30);
b2.setBackground(Color.green);
panel.add(b1); panel.add(b2);
f.add(panel);
f.setSize(400,400);
f.setLayout(null);
f.setVisible(true);
}

ToolTip Example No 15:


import javax.swing.*;
public class ToolTipExample {

public static void main(String[] args) {


// TODO Auto-generated method stub
JFrame f=new JFrame("Password Field Example");
//Creating PasswordField and label
JPasswordField value = new JPasswordField();
value.setBounds(100,100,100,30);
value.setToolTipText("Enter your Password");
JLabel l1=new JLabel("Password:");
l1.setBounds(20,100, 80,30);
//Adding components to frame
f.add(value); f.add(l1);
f.setSize(300,300);
f.setLayout(null);
f.setVisible(true);
}

Lab Instructor: SHEHARYAR KHAN Page 15

82 | P a g e
UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA
FACULTY OF TELECOMMUNICATION AND INFORMATION
ENGINEERING COMPUTER ENGINEERING DEPARTMENT

Layout Manager:

The layout manager automatically positions all the components within the container. Even if you do not use the layout
manager, the components are still positioned by the default layout manager. It is possible to lay out the controls by
hand, however, it becomes very difficult because of the following two reasons.

• It is very tedious to handle a large number of controls within the container.

• Usually, the width and height information of a component is not given when we need to arrange them.

Java provides various layout managers to position the controls. Properties like size, shape, and arrangement varies
from one layout manager to the other. When the size of the applet or the application window changes, the size, shape,
and arrangement of the components also changes in response, i.e. the layout managers adapt to the dimensions of
the appletviewer or the application window.

The layout manager is associated with every Container object. Each layout manager is an object of the class that
implements the LayoutManager interface.

Following are the interfaces defining the functionalities of Layout Managers.

Sr.No. Interface & Description

LayoutManager

1
The LayoutManager interface declares those methods which need to be implemented by the
class, whose object will act as a layout manager.

LayoutManager2
The LayoutManager2 is the sub-interface of the LayoutManager. This interface is for those
2
classes that know how to layout containers based on layout constraint object.

Lab Instructor: SHEHARYAR KHAN Page 16

83 | P a g e
UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA
FACULTY OF TELECOMMUNICATION AND INFORMATION
ENGINEERING COMPUTER ENGINEERING DEPARTMENT

AWT Layout Manager Classes:


Following is the list of commonly used controls while designing GUI using AWT.

Sr.No. LayoutManager & Description

BorderLayout

1
The borderlayout arranges the components to fit in the five regions: east, west, north, south, and
center.

CardLayout
The CardLayout object treats each component in the container as a card. Only one card is visible
2
at a time.

FlowLayout
3 The FlowLayout is the default layout. It layout the components in a directional flow.

GridLayout
4 The GridLayout manages the components in the form of a rectangular grid.

GridBagLayout

This is the most flexible layout manager class. The object of GridBagLayout aligns the

5 component vertically, horizontally, or along their baseline without requiring the components of
the same size.

GroupLayout
6 The GroupLayout hierarchically groups the components in order to position them in a Container.

SpringLayout
A SpringLayout positions the children of its associated container according to a set of
7
constraints.

Lab Instructor: SHEHARYAR KHAN Page 17

84 | P a g e
UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA
FACULTY OF TELECOMMUNICATION AND INFORMATION
ENGINEERING COMPUTER ENGINEERING DEPARTMENT

BorderLayout Example No 16.1:

import java.awt.BorderLayout;

import javax.swing.*;
public class BorderLayoutExample {

public static void main(String[] args) {


// TODO Auto-generated method stub
JFrame f=new JFrame();

JButton b1=new JButton("NORTH");;


JButton b2=new JButton("SOUTH");;
JButton b3=new JButton("EAST");;
JButton b4=new JButton("WEST");;
JButton b5=new JButton("CENTER");;

f.add(b1,BorderLayout.NORTH);
f.add(b2,BorderLayout.SOUTH);
f.add(b3,BorderLayout.EAST);
f.add(b4,BorderLayout.WEST);
f.add(b5,BorderLayout.CENTER);

f.setSize(300,300);
f.setVisible(true);
}

}
BorderLayout Example No 16.02:
import java.awt.BorderLayout;

import javax.swing.*;

public class BorderLayout {


public static void main(String[] args) {
// TODO Auto-generated method stub JFrame
f=new JFrame("Example"); JButton b=new
JButton("Set to South"); JLabel l=new
JLabel("Set to North"); JTextArea area=new
JTextArea("set to East");

f.add(b,BorderLayout.SOUTH); // adding Button to Jframe


f.add(l, BorderLayout.NORTH);
f.add(area, BorderLayout.EAST);
f.setSize(400,400); // Window width and Height

f.setVisible(true);

Lab Instructor: SHEHARYAR KHAN Page 18

85 | P a g e
UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA
FACULTY OF TELECOMMUNICATION AND INFORMATION
ENGINEERING COMPUTER ENGINEERING DEPARTMENT

GRID LAYOUT:

The GridLayout is used to arrange the components in rectangular grid. One component is displayed in each
rectangle.

Constructors of GridLayout class

1. GridLayout(): creates a grid layout with one column per component in a row.

2. GridLayout(int rows, int columns): creates a grid layout with the given rows and columns but no gaps
between the components.

3. GridLayout(int rows, int columns, int hgap, int vgap): creates a grid layout with the given rows and
columns alongwith given horizontal and vertical gaps.

GridLayout Example No 17:

import java.awt.GridLayout;

import javax.swing.*;

public class GridLayoutExample {

public static void main(String[] args) {


// TODO Auto-generated method stub
JFrame f=new JFrame();

JButton b1=new JButton("1");


JButton b2=new JButton("2");
JButton b3=new JButton("3");
JButton b4=new JButton("4");
JButton b5=new JButton("5");
JButton b6=new JButton("6");
JButton b7=new JButton("7");
JButton b8=new JButton("8");
JButton b9=new JButton("9");

f.add(b1);f.add(b2);f.add(b3);f.add(b4);f.add(b5);
f.add(b6);f.add(b7);f.add(b8);f.add(b9);

f.setLayout(new GridLayout(3,3));
//setting grid layout of 3 rows and 3 columns

Lab Instructor: SHEHARYAR KHAN Page 19

86 | P a g e
UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA
FACULTY OF TELECOMMUNICATION AND INFORMATION
ENGINEERING COMPUTER ENGINEERING DEPARTMENT

f.setSize(300,300);
f.setVisible(true);
}

Flow Layout:

The FlowLayout is used to arrange the components in a line, one after another (in a flow). It is the default layout of
applet or panel.

Fields of FlowLayout class

1. public static final int LEFT

2. public static final int RIGHT

3. public static final int CENTER

4. public static final int LEADING

5. public static final int TRAILING

Constructors of FlowLayout class

1. FlowLayout(): creates a flow layout with centered alignment and a default 5 unit horizontal and vertical gap.

2. FlowLayout(int align): creates a flow layout with the given alignment and a default 5 unit horizontal and
vertical gap.

3. FlowLayout(int align, int hgap, int vgap): creates a flow layout with the given alignment and the given
horizontal and vertical gap.

Lab Instructor: SHEHARYAR KHAN Page 20

87 | P a g e
UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA
FACULTY OF TELECOMMUNICATION AND INFORMATION
ENGINEERING COMPUTER ENGINEERING DEPARTMENT

FlowLayout Example No 17:

import java.awt.FlowLayout;

import javax.swing.*;

public class FlowLayoutExample {

public static void main(String[] args) {


// TODO Auto-generated method
stub JFrame f=new JFrame();

JButton b1=new JButton("1");


JButton b2=new JButton("2");
JButton b3=new JButton("3");
JButton b4=new JButton("4");
JButton b5=new JButton("5");

f.add(b1);f.add(b2);f.add(b3);f.add(b4);f.add(b5);

f.setLayout(new FlowLayout(FlowLayout.RIGHT));
//setting flow layout of right alignment
// f.setLayout(new FlowLayout(FlowLayout.LEFT));
f.setSize(300,300);
f.setVisible(true);
}

Self Study :

*BoxLayout, CardLayout,GridBagLayout,GroupLayout,SpringLayout,ScrollPaneLayout

Lab Instructor: SHEHARYAR KHAN Page 21

88 | P a g e
UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA
FACULTY OF TELECOMMUNICATION AND INFORMATION
ENGINEERING COMPUTER ENGINEERING DEPARTMENT

Tasks No 01:
Design this Form Using Swing Controls ?

Task 02:
Design this Login Form Using Swing Controls?

Task 03 : Design Non Functional Calculator using Swing Controls?


Lab Instructor: SHEHARYAR KHAN Page 22

89 | P a g e
UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA
FACULTY OF TELECOMMUNICATION AND INFORMATION
ENGINEERING COMPUTER ENGINEERING DEPARTMENT

Task 04 Design this Form using Swing Controls ?

The End

Lab Instructor: SHEHARYAR KHAN Page 23

90 | P a g e

You might also like