Download as xlsx, pdf, or txt
Download as xlsx, pdf, or txt
You are on page 1of 12

1 AWT stands for

2 How many layout managers defined in java.awt package?


3 Which method used to place some text in the text field?

4 Which are passive controls that do not support any interaction with the user?

5 The various controls supported by AWT are:


6  Java applet are used to create_______applications.
Which of the following is used to interpret and execute Java Applet Classes Hosted
7 by HTML?
8 Executable applet is nothing but __ file of the applet. 
When applet is dead, it automatically invokes the_____method when We
9 quit the browser.
10 Which of the following command is used to compile java program?
Which can be used to represent a checkbox with a textual label that can appear in
11 a menu?
12 Which methods in applet executes only once?
Which of these classes can be added to any Container class, using the add method
13 defined in Container class?
14 Which of these classes can be added to a Frame component?
15 Which of the following class is derived from the container class?
16 Which abstract class is the super class of all menu related classes?
17 Package of drawString() method is________
18 Which method is used to count the number of items is the List.

19 Which is the correct constructor of GridLayout.
20 Public class MenuBar extends ____________.
Which class is used to represent a single line 
21 textbox with password character facility?
22 To set the title to the Frame window ________ method is used.
23 The default layout of Applet is _______.
24 Which of the following package is used for  Graphical User Interface?  
25 Which method is used to set password character  for a TextField? 

26 Which component of AWT provides compact,  multichoice, scrolling component?
___________ positions are the components into 5 regions east, west, south, north,
27 center.

28 What are the types of DialogBox?
29 What is default layout for Dialog?
30 Which method is used to check the status of checkbox?
31 ___________method returns currently selected item in choice.
32 Which of the following method is used to set a TextComponent to read ‐only mode?
Frame is a standard window, which is
33 of Window class from AWT hierarchy?
__________________positions are the components into 5 regions east, west,
34 south, north, center.

35 The correct hierarchy for Panel is ___________________


In the give constructor what third parameter indicates : ScrollBar s = new
36 ScrollBar(0,10,20,0,1000);
Java Applets are used to create
37 applications
38 _______________generates action events when an item is double ‐clicked.

39 What does the following line of code do? TextField tf = new TextField(10);

40 Which component of AWT provides compact, multichoice, scrolling component?


41 Which class defines setSize( ) method?
42 The method_______________places a Menu m into the MenuBar mb.
43 Which package is used for import the swing components?

The String parameter to JButton constructor


44 .

45 MVC architecture is__________________


46 In swing, Buttons are subclasses of which class?
47 JTree class belongs to which package
48 Which component is swing represents data in row and columns?
49 Which of the following is not constructor of JTree?
50 ________________class used to create node in tree.
51 JTabbedPane class is present in which package?

52 What is purpose of JTree?

53 What is the use of : Container getContentPane( )

54 Which of the following method is used to retrieve icon of JButton?


Which component provides support for two ‐state
55 buttons?
56  What is the name of the Swing class that is used for frames?

57 Which of the following classes in Java contains swing version of an applet?


58  Which of the following classes of Java swing extends Applet class?
In Java swing, which of the following components is/are represented by a
59 rectangular area in which a component may be viewed?
60 Swing elements are preceded by the letter
The following specifies the advantages of
It is lightweight.
It supports pluggable look and feel.
61 It follows MVC (Model View Controller) architecture.
Which of the following method is not applicable
62 for Button in swing.
The Swing Component classes that are used in
63 Encapsulates a mutually exclusive set of buttons?
64 JButtons generate what type of event?

65 Which of the following is false?

66 What happens if setSize is not called on a JFrane (assume pack is not called)?
What code adds this JButton to this JPanel?
JPanel panel = new JPanel();
67 JButton button = new JButton();

68 Which of the following is true about AWT and Swing components.


69 Which method will cause a Frame to be displayed?
The ActionListener interface is used for handling action events,For example,it's
70 used by a
The Following steps are required to perform ____

1) Implement the Listener interface and overrides its methods


71 2) Register the component with the Listener
The Swing Component classes that are used in Encapsulates a mutually exclusive
72 set of buttons?

73 What is an event in delegation event model used by Java programming language?


74 From following list which is not Swing class?
75 JButton class is present in which package?
76 JCheckBox is component defined in .......................package
77 Swing components are
78 MutableTreeNode is extends.................. interface
79 In swing MVC architecture used in that M stands for

80 What is the purpose of JTable?

81 Event is called as?

82 Which of these methods are used to register a keyboard event listener?

83 Which of these methods are used to register a mouse motion listener?


creates a new object of a specific class (in this case a new JFrame object called
84 myFrame) is generally called a ...
85 What are the names of the list layout managers in Java?
Which of these methods can be used to know the degree of adjustment made by
86 the user?
Which package provides many event classes and Listener interfaces for event
87 handling?
88 MouseEvent is subclass of which of the following class?

89 Which method is used to process mouse click?

90 ActionEvent is applied on
91 Which of these events is generated when a button is pressed?
92 Which of these class is super class of all the events?

93 What is the use of String getActionCommand( ) method of ActionEvent class?


94 The is an object that is notified when an event occurs.
95 Button Control implements following listener interface.
a b c
All Window Toolkit Abstract Work Toolkit Abstract Window Toolkit
 2 3 4
getText(String str) setText(String str) putText(String str)

Choice List Labels

Labels, push buttons Checkboxes, choice list Scroll bars, text fields, text area
graphical        user interactive both (a) and (b)  

Appletviewer Appletscreen Appletwatcher     


 .txt   .java  .class

Paint()    Stop() Destroy() 


Java           Javap Javaq         

MenuBar                              Menuitem CheckboxMenuItem                    


start() method init() method stop() method

Button              CheckboxMenuItem Menu


Menu             Button Window          
Component                      Panel MenuComponent                
MenuComponent          MenuBar MenuItem               
java.applet java.io javax.swing   
getItem( )   getSelectedItem( )  getItemCount( )
GridLayout(int num_rows, int GridLayout(int rows, int cols, int
GridLayout(int a) num_columns) vert)
MenuComponent   MenuContainer   ComponentMenu  

TextField TextArea   Label


void setTitle(String str) void setText(String str) void settitle(String str)
GridLayout   CardLayout   FlowLayout  
java.applet   java.awt  java.awt.image
setPasswordCharacter( )  setEchoChar( )  setPassChar( )

List   Choice   Panel  


CardLayout   BorderLayout   GridLayout  

Modal and Modeless DialogBo
 Modal DialogBox  x  Modam  
FlowLayout   GridLayout   CardLayout  
getStatus( ) getState( ) isChecked( )
 getSelectedItem( ) getSelectedElement( ) getSelectedIndex( )
Editable( ) nonEditable( ) setEchoChar( )
Base class /
Derived class / Subclass Super class Root class

CardLayout BorderLayout GridLayout


Component – Container – Component – Container –
Window – Panel Applet – Panel Component – Container – Panel

size of thumb minimum value Increment value

Graphical user interactive Both A & B


List Checkbox MenuItem
will set 10 to TextField as its initial Will set the character capacity
text. to 10 Both A & B

List Choice Panel


Frame Applet Component
mb.addMenuItem(m) mb.addItem(m) mb.add(m)
java.swing java.awt javax.swing

tell which region to put the JButton tells what text will appear on
in. tells the color of the JButton. JButton.

Modelling – Visual – Controller Model – View – Controller Model – Viewable – Controller


AbstractButton Jbutton Button
java.awt java.applet java.swing
JTextArea Jtable Jpanel
JTree(TreeNode tn) JTree(Vector v) JTree(int x)
TreeNode DefaultMutableNode DefaultMutableTreeNode
java.awt java.swing java.awt.swing
To show data in form of parent and
child nodes. To show data in list view. To show data in tabular form.
Returns a ContentPane for Returns a ContentPane for
Returns Container for a JDialog. Menu Applet

Icon getIcon( ) ImageIcon getImageIcon( ) ImageIcon getIcon( )

Button, Checkbox JCheckBox,JRadioButton Button, MenuItem


Window Frame JFrame

JButton JCheckBox JApplet


JButton JApplet AbstractButton

Scroll pane Tabbed pane Combo boxes


S A X

Swing AWT Both A & B

setDiableIcon( ) setPressedIcon( ) setSelectedIcon( )

AbstractButton ButtonGroup JButton


ActionEvents ChangeEvents WindowEvents

JFrame is a lightweight JFrame is a subclass of Frame


component. (which is a subclass of JFrames have a title bar and a
Window). border.
The window is displayed at its
preferred size. It is a syntax error. The window is not displayed.

panel.add(button); button.add(panel); frame.add(panel);

AWT components creates a process AWT components creates a


where as swing components thread where as swing Both AWT and Swing
creates a thread components creates a process components creates a process
show () setVisible () display()

JButton JCheckbox JMenuItem

String Handling Exception Handling Event Handling

ImageIcon Jbutton ButtonGroup


An event is an object that An event is an object that
An event is an object that describes describes a state change in describes any change by the
a state change in a source processing user and system
JLabel JButton JImageIcon
java.awt java.swing java.awt.swing
Awt Net Javax
Platform dependent Platform independent Both a & b
TreePath TreeNode DefaultMutableTreeNode
Main Muiti-Level Model
JTable object displays JTable object displays rows and
JTable object displays rows of data columns of data columns of data
Object that describe any
Object that describe a state change change by the user and Event is class defining only
in processing system object

addKeyListener()
KeyListener() addKistener()

addMouse() addMouseListener() addMouseMotionListner()

Constructor Layout manager Parameter


Flow Layout Manager Grid Layout Manager Box Layout Manager

   getValue( ) getAdjustmentType( ) getAdjustmentValue( )

java.awt  java.awt.Graphics java.awt.event


ComponentEvent ContainerEvent ItemEvent
public void
public void mouseIsClicked(MouseEvent public void
mouseClicked(MouseListener m) m) mouseClicked(MouseEvent m)

Frame Checkbox, Choice, List Scrollbar


ActionEvent KeyEvent WindowEvent
EventObject EventClass ActionEvent

to obtain the label (caption) of to obtain the reference of


Button Button to obtain object of Button
Listener Sources Event
ItemListener ActionListener FlowListener
d Ans
Abstract Window Text c Chapter 1
5 d Chapter 1
None of the above b Chapter 1

Checkbox c Chapter 1
All of these d
Chapter 1
none of the above c Chapter 1

Appletshow a Chapter 1
.html c Chapter 1

Final() c Chapter 1
Javac d Chapter 1

Menu c Chapter 1
java.awt b Chapter 1

MenuBar a Chapter 1
Applet b Chapter 1
List b Chapter 1
CheckboxMenuItem a Chapter 1
java.awt b Chapter 1
  getCount( )  c Chapter 1

GridLayout(int hor) b Chapter 1


MenuBar  a Chapter 1

Checkbox a Chapter 1
None of the above a Chapter 1
BorderLayout  c Chapter 1
java.io  b Chapter 1
setEchoCharacter( )  b Chapter 1

TextArea  a Chapter 1
FlowLayout 
b Chapter 1

 None of the above  b Chapter 1
BorderLayout  a Chapter 1
getChecked( ) b Chapter 1
getItem( ) a Chapter 1
setEditable( ) d Chapter 1

Family class a Chapter 1

FlowLayout b Chapter 1
Container – Component –
Panel c Chapter 1

Initial Value a Chapter 1

None of these c Chapter 1


TextField c Chapter 1

None of These b Chapter 1

TextArea a Chapter 1
Panel c Chapter 1
None of these c Chapter 1
All of the above c Chapter 2

tells what should happen c


when JButton is pressed. Chapter 2
b
Many – View – Controller Chapter 2
JRadioButton a Chapter 2
javax.swing d Chapter 2
JtabbedPane b Chapter 2
none of the above c Chapter 2
Node c Chapter 2
javax.swing d Chapter 2
a
To show data in menu‐bar. Chapter 2
c
None of the above Chapter 2
ImageIcon
GetImageIcon( ) c
Chapter 2
c
JCheckBox, TextField Chapter 2
SwingFrame c Chapter 2
c
AbstractButton Chapter 2
None of these b Chapter 2
a
None of these Chapter 2
J d Chapter 2

a
None of the above Chapter 2
c
setRollOverIcon( ) Chapter 2
b
ImageIcon Chapter 2
MouseEvents a Chapter 2

A JFrame window will look a


like all other windows
displayed on that platform. Chapter 2
a
Only the title bar appears Chapter 2

a
panel.add(JButton); Chapter 2

Both AWT and swing c


components creates a
thread Chapter 2
displayFrame () b Chapter 2
a
All of these Chapter 2

c
None of the above Chapter 2
c
AbstractButton Chapter 2
An event is a class used for
defining object, to create a
events Chapter 2
JCheckBox c Chapter 2
javax.swing d Chapter 2
Swing d Chapter 2
Platform Oriented b Chapter 2
MutableTreeNode b Chapter 2
Method c Chapter 2
JTable object displays data c
in Tree form Chapter 2

Object that describe a state d


change in source Chapter 2

eventKeyboardListener() c Chapter 2
eventMouseMotionListener
() c Chapter 2

GUI a Chapter 2
All of the above d Chapter 2

    getAdjustmentAmount( ) c Chapter 2

None of the above C Chapter 3


InputEvent D Chapter 3
public void
mouseClick(MouseEvent
m) C Chapter 3
Button, TextField, List,
Menu D Chapter 3
AdjustmentEvent A Chapter 3
ItemEvent A Chapter 3
to obtain the label
(caption) and object of
Button A Chapter 3
None of the above A Chapter 3
Adapter B Chapter 3

You might also like