You are on page 1of 3

AJP IMP Questions

Which of these methods can be used to know which key is pressed ? getModifiers()
1 A) getActionEvent() B) getActionKey() C) getModifier() D) getKey()

Give the abbreviation of AWT?


A)Applet Windowing Toolkit B)Abstract Windowing Toolkit Abstract Window
2
C)Absolute Windowing Toolkit D)None of the above Toolkit

What layout is used to divide a frame into five areas: north, south, east, west,
and center?
3 BorderLayout
A) BorderLayout B) BoxLayout C) FlowLayout D) GridLayout

Which of these class is super class of all the events?


4 A) EventObject B) EventClass C)ActionEvent D)ItemEvent EventObject

All Component on Container can be removed by calling following method


5 A) removeAll() B) delete() C) Edit() D) DeleteAll() removeAll()

Which of these events will be notified if scroll bar is manipulated?


6 A) ActionEvent B) ComponentEvent AdjustmentEvent
C) AdjustmentEvent D) WindowEvent
7 The method in the ActionEvent ________ returns the action command of the
button
A) getCommand() B) setActionCommand() getActionCommand()
C) getActionCommand() D) getAction()

Plugable Look & Feel is the feature of


8 A) AWT B) Swing C) Container D) ActionListener Swing

Arranges the components as a deck of cards such that only one component is
9 visible at a time CardLayout
A) CardLayout B) BorderLayout C) GridLayout D) GridBagLayout

List can be created for multiple selection by using following constructor


List(int num,boolean
10 A) List(int a,char b) B) List(int num,int A)
multiselect)
C) List(int num,boolean multiselect) D) List( int X, int Y)
Which of these methods are used to register a mouse motion listener addMouseMotionList
A) addMouse() B) addMouseListener() ner()
11
C) addMouseMotionListner() D) eventMouseMotionListener()

12 A __________ automatically arranges the components added to a container. JTabbedPane

removeAll()
13 All Component on Container can be removed by calling following method

Arranges the components as a deck of cards such that only one component is
14 CardLayout
visible at a time
15 Each menu is associated with a ___________list of menu items Drop-down

16 How To Apply Image To Button ? Using ImageIcon

In Graphics class Which method is used to set the graphics current color to public abstract void
17
the specified color? setColor(Color c)
18
Which of the following component class cannot be add on applet Menu

Which one method is used to set the visibility of the frame?


19 setVisible(true)
A) setVisible(true) B) setVisible(false) C) setVisible() D) None

What is the name of the Swing class that is used for frames?
20 JFrame
A) Window B) Frame C) JFrame D) Panel

Event class is defined in which of these libraries?


21 java.util
A) java.io B) java.lang C) java.net D) java.util

Which of these packages contains all the classes and methods required for
22 event handling in Java? java.awt.event
A) java.awt B) java.event C) java.applet D) java.awt.event
Which of these class is super class of all the events?
23 A) EventObject B) EventClass C) ActionEvent D) temEvent EventObject

A________is Componenet that represents a hierarchical view of data


A) JBuuton B) Jtree C) JList D) JCheckbox
24 Jtree
Which of these events will be generated if we close an applet’s window?
25 A) ActionEvent B) ComponentEvent WindowEvent
C) AdjustmentEvent D)WindowEvent
Default orientation of progress bar is:
26 A) Horizontal B) Vertical C) Left D) Bottom Horizontal

Panel is used for __________ components A)


27 Grouping
Muliple B) Single C) Grouping D) both a and b
28 Who invented Java Programming? James Gosling
A) Guido van Rossum B) James Gosling C)
Dennis Ritchie D) Bjarne Stroustrup

29 Event class is defined in which of these libraries? java.util


a) java.io b) java.lang c) java.net d) java.util

30 Which component is used to compile, debug and execute the java programs?
A) JRE B) JIT C) JDK D) JVM
JDK
31 Border Layout is divided into_________regions five
A) five B) one C) two D) three
32 Which of these events will be generated if we close an applet’s window? Window Event
A) ActionEvent B) Component Event
C) AdjustmentEvent D) Window Event
33 Plugable Look & Feel is the feature of Swing

34 Positions the componenets into five regions:east,west,north,south,center BorderLayout

35 Program which executes applet is known as________ Appletviewer

36 public class MenuBar extends ____________________ MenuComponent

37 Scrollbar( ) creates a ______________ scroll bar by default. Vertical

The AWT container is an instance of the ___________ class which holds


38 Container
various components and other containers

CardLayout() // First
39 The CardLayout class defines the following constructors: Cardlayout(int hor, int ver)
//second

40 JCheckBox is _______________________Component lightweight

41 JRadioButton is a subclass of ________. AbstractButton

42 JTabbedPane class is present in which package? javax.swing

43 Jtree class comes under which package javax.swing

swing is the set of ____________ that provides more powerful &


44 Classes
flexible components as compare to AWT.

tells what text will appear on the


45 The string parameter to the JButton constructor
button

What letter precedes Swing component names that have a corresponding


46 J
AWT component?

47 Which of these events is generated when the a window is closed? WindowEvent

48 ________method are used to register a keyboard event listener addKeyListener()

49 CheckBox implements following Listener Interface ItemListener

50 Change in the state of an object is known as __________ Event

You might also like