0% found this document useful (0 votes)
40 views25 pages

Ajp 2

Uploaded by

matetisantosh37
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)
40 views25 pages

Ajp 2

Uploaded by

matetisantosh37
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/ 25

E Remove Watermark Wondershare

A R Msbtebook.blogspot.com
PDFelement

AV
CH
AL
S H
VI

Subject:- AJP Code:- 22517


Course Code:- CO/CM/CW/IF-5I Semester:- Fifth

Prof. Vishal Chavare

Msbtebook.blogspot.com Vishal Chavare


https://www.gunwantmankar.com
/ 1
E Remove Watermark Wondershare

A R Msbtebook.blogspot.com
PDFelement

AV
CH
AL
S H
VI

Msbtebook.blogspot.com Vishal Chavare


https://www.gunwantmankar.com
/ 2
E Online Exam pattern are as follows:Remove Watermark Wondershare

A R Msbtebook.blogspot.com
PDFelement

AVTotal questions are: 42 Time:- 90 Minutes


CH Detail online exam pattern are as follows with chapter wise questions
AL
SH
Distribution of Marks
Unit

VI
Unit Title R U A Total
No
Level Level Level Marks
Abstract Windowing Tool
1 2 4 6 12
Kit (AWT)
2 Swing 2 2 6 10
3 Event Handling 2 2 8 12
4 Networking Basics 2 4 4 10
Interacting with
5 2 4 6 12
Database
6 Servlets 4 4 6 14
Total 14 20 36 70

• (R) Remember Level (Basic Level):-Total Question:-14 (1 mark each)


These are very simple questions and it will not take more than 15 to 20 minutes to solve.

• (U) Understand Level:- Total Question:-10 (2 marks each).


These are understand level questions, difficulty level little increases.

• (A) Apply Level:- Total Question:-18 (2 marks each).


These are apply level questions means you have to apply your knowledge to solve these
questions and again difficulty level is increases.
Msbtebook.blogspot.com Vishal Chavare
https://www.gunwantmankar.com
/ 3
E Remove Watermark Wondershare

A R Msbtebook.blogspot.com
PDFelement

AV
CH
AL Distribution of Marks
SH Unit
VI No
Unit Title R U A
Level Level Level Total Marks

Abstract Windowing Tool Kit


1 2 4 6 12
(AWT)

2 Swing 2 2 6 10

3 Event Handling 2 2 8 12

4 Networking Basics 2 4 4 10

5 Interacting with Database 2 4 6 12

6 Servlets 4 4 6 14

Total 14 20 36 70

Msbtebook.blogspot.com Vishal Chavare


https://www.gunwantmankar.com
/ 4
E Remove Watermark Wondershare

A R Msbtebook.blogspot.com
PDFelement

AV
CH
AL
S H 2.1. Introduction to Swings: Swing Features, Difference
VI between AWT & Swings.

2.2. Swing Components: JApplet, Icons and Labels,


Text Fields, Combo Boxes.

2.3. Buttons: The Jbutton, CheckBoxes, Radio Buttons,

2.4.Advanced Swing Components:TabbedPanes, Scroll


Panes, Trees, Tables, Progress bar, tool tips.
2.5. MVC Architeture.

Msbtebook.blogspot.com Vishal Chavare


https://www.gunwantmankar.com
/ 5
E Remove Watermark Wondershare

A R Msbtebook.blogspot.com
PDFelement

AV
CH
AL  Package : javax.swing.*
S H
VI  Swing is set of classes which provides more powerful and flexible
components as compare to AWT.
 Build on top of AWT API and acts as replacement of AWTAPI.
 Swing component follows a Model-View-Controller
 Swing Components are implemented using Java and so they are
platform independent.
 Called lightweight components
 100 % Java implementations of components.
 Use MVC architecture.
 Model represents the data
 View as a visual representation of the data
 Controller takes input and translates it to changes in data

Msbtebook.blogspot.com Vishal Chavare


https://www.gunwantmankar.com
/ 6
E Remove Watermark Wondershare

A R Msbtebook.blogspot.com
PDFelement

AV
CH
AL
S H
VI

Msbtebook.blogspot.com Vishal Chavare


https://www.gunwantmankar.com
/ 7
E Remove Watermark Wondershare

A R Msbtebook.blogspot.com
PDFelement

AV
CH
ALNo Java AWT Java Swing
S H
VI 1) AWT components are platform-dependent. Java swing components are platform-
independent.
2) AWT components are heavyweight. Swing components are lightweight.

3) AWT doesn't support pluggable look and feel. Swing supports pluggable look and feel.

4) AWT provides less components than Swing. Swing provides more powerful
components such as tables, lists, scrollpanes,
colorchooser, tabbedpane etc.
5) AWT doesn't follows MVC(Model View Controller) Swing follows MVC.

 AWT uses Applet and Frame while Swing uses JApplet and JFrame
for GUI.
 Swing has bigger collection of classes and interfaces as compare to AWT.
 In Swing extra feature to Button: Provide Image.

Msbtebook.blogspot.com Vishal Chavare


https://www.gunwantmankar.com
/ 8
E Remove Watermark Wondershare

A R Msbtebook.blogspot.com
PDFelement

AV
CH
AL
 Abstract Button

S H  ButtonGroup
VI  ImageIcon
 JApplet
 JButton
 JCheckBox
 JComboBox
 JLabel
 JRadioButton
 JScrollPane
 JTabbedPane
 JTable
 JTextField
 JTree

Msbtebook.blogspot.com Vishal Chavare


https://www.gunwantmankar.com
/ 9
E Remove Watermark Wondershare

A R Msbtebook.blogspot.com
PDFelement

AV
CH
AL
SH
 Extends JApplet/JFrame class.
VI  Design UI in init() or Constructor method.
 Add all components on Container instead on
JApplet/JFrame.
 getContentPane() method returns the container object.
 Call container add() method to add components.
 For JFrame close operation: setDefaultCloseOperation()
 Parameters:
 DISPOSE_ON_CLOSE
 EXIT_ON_CLOSE
 DO_NOTHING_ON_CLOSE

Msbtebook.blogspot.com Vishal Chavare


https://www.gunwantmankar.com
/ 10
E Remove Watermark Wondershare

A R Msbtebook.blogspot.com
PDFelement

V
 A Small display area for text, image or both.

CH Extends Jcomponent.


AL Constructors:
SH

VI  JLabel(Icon i)
 JLabel(String s)
 JLabel(String s, Icon i, int align)
align argument is either LEFT, RIGHT, CENTER,
 ImageIcon:
 ImageIcon(String filename)
 ImageIcon(URL url)
 The ImageIcon class implements the Icon interface that declares the methods
 int getIconHeight( )
 int getIconWidth( )
 Other methods:
 Icon getIcon( ) 1
 String getText( ) 1
 void setIcon(Icon i) https://www.gunwantmankar.com
Msbtebook.blogspot.com / Vishal Chavare 1
 void setText(String s)
E Remove Watermark Wondershare

A R Msbtebook.blogspot.com
PDFelement

AV
CH java.lang.Object
AL
S H java.awt.Component
V I java.awt.Container
javax.swing.JComponent
javax.swing.text.JTextComponent
javax.swing.JTextField

Constructor
JTextField( )
JTextField(int cols)
JTextField(String s, int cols)
JTextField(String s)

Msbtebook.blogspot.com Vishal Chavare


https://www.gunwantmankar.com
/ 12
E Remove Watermark Wondershare

A R Msbtebook.blogspot.com
PDFelement

AV
Combination of text field and drop down list.

H
CSubclass of JComponet
AL

S H  Only one entry can view at a time.


VI
 Constructor:
 JComboBox( )
 JComboBox(Vector v)
 void addItem(Object obj): Used to add object in Combobox

 ItemEvent is generated.
 Implements ItemListener interface
 Override: itemStateChnaged(ItemEvent ie) method defined by
ItemListener.

Msbtebook.blogspot.com Vishal Chavare


https://www.gunwantmankar.com
/ 13
E Remove Watermark Wondershare

A R Msbtebook.blogspot.com
PDFelement

AV
 C H
Swing provide Icon with Button text.
A L Swing buttons are subclasses of the AbstractButton class, which extends
S H Jcomponent.
VI  AbstractButton contains many methods that allow you to
control the behavior of buttons, check boxes, and radio buttons.
 Setter and Getter:
 String getText( )
 void setText(String s)

 Constructors:
 JButton(Icon i)
 JButton(String s)
 JButton(String s, Icon i)
Msbtebook.blogspot.com Vishal Chavare
https://www.gunwantmankar.com
/ 14
E Remove Watermark Wondershare

A R Msbtebook.blogspot.com
PDFelement

V
Ajava.lang.Object
CH java.awt.Component

AL
java.awt.Container
javax.swing.JComponent

S H javax.swing.AbstractButton

VI javax.swing.JToggleButton
javax.swing.JCheckBox
Constructor
JCheckBox(Icon i)
JCheckBox(Icon i, boolean state)
JCheckBox(String s)
JCheckBox(String s, boolean state)
JCheckBox(String s, Icon i)
JCheckBox(String s, Icon i, boolean state)
 void setSelected(boolean state)
 ItemEvent is generated.
 ItemListener interface is needed to handle ItemEvent.
 Public itemStateChanged() used to override.

Msbtebook.blogspot.com Vishal Chavare


https://www.gunwantmankar.com
/ 15
E Remove Watermark Wondershare

A R Msbtebook.blogspot.com
PDFelement

AV java.lang.Object
CH java.awt.Component

AL
java.awt.Container
javax.swing.JComponent
S H javax.swing.AbstractButton
VI javax.swing.JToggleButton
javax.swing.JRadioButton
JRadioButton(Icon i)
JRadioButton(Icon i, boolean state)
JRadioButton(String s)
JRadioButton(String s, boolean state)
JRadioButton(String s, Icon i)
JRadioButton(String s, Icon i, boolean state)
 ButtonGroup class is used to add radio button in group.
 ActionEvent is generated.
 ActionListener Listener interface is needed to handle ActionEvent.
 public void actionPerofrmed() used to override.

Msbtebook.blogspot.com Vishal Chavare


https://www.gunwantmankar.com
/ 16
E Remove Watermark Wondershare

A R Msbtebook.blogspot.com
PDFelement

AV
CH
AL A tabbed pane is a component that appears as a group of folders in
SH
V I a file cabinet.
 Each folder has a title.
 When a user selects a folder, its contents become visible.
 Only one of the folders may be selected at a time.
 Subclass of Jcomponent
 Tabs are defined via the following method :
 void addTab(String str, Component comp)

 Str: title of pane

 Comp: component, it can be JPanel

Msbtebook.blogspot.com Vishal Chavare


https://www.gunwantmankar.com
/ 17
E Remove Watermark Wondershare

A R Msbtebook.blogspot.com
PDFelement

AV

CHA scroll pane is a component that presents a rectangular area in
AL which a component may be viewed.
S H  Subclass of JComponent
VI
 Constructor:
 JScrollPane(Component comp)
 JScrollPane(int vsb, int hsb)
 JScrollPane(Component comp, int vsb, int hsb)
 Comp: Component, vsb and hsb: Scrollbar constant
 HORIZONTAL_SCROLLBAR_ALWAYS
 HORIZONTAL_SCROLLBAR_AS_NEEDED
 VERTICAL_SCROLLBAR_ALWAYS
 VERTICAL_SCROLLBAR_AS_NEEDED
.

Msbtebook.blogspot.com Vishal Chavare


https://www.gunwantmankar.com
/ 18
E Remove Watermark Wondershare

A R Msbtebook.blogspot.com
PDFelement

AV
CH
•LCheck box is selected or deselected, an item event is
A
H
S generated.
I
V • For handling implements ItemListener interface
• ItemListener interface is defines itemStateChanged( )
method.
• ItemEvent object is supplied as the argument.
• getState() : Get Status about checkbox.

• Following methods determine and set status:


• Checkbox getSelectedCheckbox( )
• void setSelectedCheckbox(Checkbox which)
Msbtebook.blogspot.com Vishal Chavare
https://www.gunwantmankar.com
/ 19
E Remove Watermark Wondershare

A R Msbtebook.blogspot.com
PDFelement

AV

CHA tree is a component that presents a hierarchical view of data.
AL  Trees are implemented in Swing by the JTree class, which extends

S H JComponent.
VI  Constructors:
 JTree(Hashtable ht)
 JTree(Object obj[ ])
 JTree(TreeNode tn)
 JTree(Vector v)
 A JTree object generates events when a node is expandedor collapsed.
 The addTreeExpansionListener( ) and removeTreeExpansionListener( ) methods allow
listeners to register and unregister for these notifications.
 Signature for these methods:
 void addTreeExpansionListener(TreeExpansionListener tel)
 void removeTreeExpansionListener(TreeExpansionListener tel)

Msbtebook.blogspot.com Vishal Chavare


https://www.gunwantmankar.com
/ 20
E Remove Watermark Wondershare

A R Msbtebook.blogspot.com
PDFelement

AV
 CHTo create a hierarchy of tree nodes, the add( ) method of
AL DefaultMutableTreeNode can be used.

S H  void add(MutableTreeNode child)

VI  Tree Expansion event described by class:


 TreeExpansionEvent (Package: javax.swing.event)
 The getPath( ) method of this class returns a TreePath.
 TreePath getPath( )
 TreeExpansionListener interface provides the following two methods
 void treeCollapsed(TreeExpansionEvent tee)
 void treeExpanded(TreeExpansionEvent tee)

 Steps to create Jtree:

1. Create a JTree object.


2. Create a JScrollPane object.
3. Add the tree to the scroll pane.
4. Add the scroll pane to the content pane of the applet.

Msbtebook.blogspot.com Vishal Chavare


https://www.gunwantmankar.com
/ 21
E Remove Watermark Wondershare

A R Msbtebook.blogspot.com
PDFelement

AV
CHA table is a component that displays rows and columns of data.

AL You can drag the cursor on column boundaries to resize columns.

S H  You can also drag a column to a new position.


VI
 Subclass of JComponent
 Constructor:
 JTable(Object data[ ][ ], Object colHeads[ ])
 data is a two-dimensional array of the information
 colHeads is a one-dimensional array with the column headings.
 Steps to create Jtable

1. Create a JTable object.


2. Create a JScrollPane object.
3. Add the table to the scroll pane.
4. Add the scroll pane to the content pane of the JApplet or JFrame.

Msbtebook.blogspot.com Vishal Chavare


https://www.gunwantmankar.com
/ 22
E Remove Watermark Wondershare

A R Msbtebook.blogspot.com
PDFelement

AV
CH
AL Software design pattern for software development.
SH
VI  Model:
 Major function of this layer to maintain the data.
 Database and logic.
 View:
 Used to display full or partial data.
 User Interface
 Controller:
 Control the interaction and communication between Model and view.
 Communication logic/integration logic

Msbtebook.blogspot.com Vishal Chavare


https://www.gunwantmankar.com
/ 23
E Remove Watermark Wondershare

A R Msbtebook.blogspot.com
PDFelement

AV
CH
AL
S H
VI

Msbtebook.blogspot.com Vishal Chavare


https://www.gunwantmankar.com
/ 24
E Remove Watermark Wondershare

A R Msbtebook.blogspot.com
PDFelement

AV
CH
AL
S H
VI

Msbtebook.blogspot.com Vishal Chavare


https://www.gunwantmankar.com
/ 25

You might also like