You are on page 1of 4

AJP IMP Questions

Which of these methods can be used to know which key is pressed ?


1 A) getActionEvent() B) getActionKey() C) getModifier() D) getKey()

Give the abbreviation of AWT?


2 A)Applet Windowing Toolkit B)Abstract Windowing Toolkit
C)Absolute Windowing Toolkit D)None of the above
What layout is used to divide a frame into five areas: north, south, east, west,
3 and center?
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

All Component on Container can be removed by calling following method


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

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


6 A) ActionEvent B) ComponentEvent
C) AdjustmentEvent D) WindowEvent
7 The method in the ActionEvent ________ returns the action command of the
button
A) getCommand() B) setActionCommand()
C) getActionCommand() D) getAction()
Plugable Look & Feel is the feature of
8 A) AWT B) Swing C) Container D) ActionListener

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

List can be created for multiple selection by using following constructor


10 A) List(int a,char b) B) List(int num,int A)
C) List(int num,boolean multiselect) D) List( int X, int Y)
Which of these methods are used to register a mouse motion listener
A) addMouse() B) addMouseListener()
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

Using
16 How To Apply Image To Button ?
ImageIcon
public abstract
In Graphics class Which method is used to set the graphics current color to void
17
the specified color? setColor(Colo
r 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 A) setVisible(true) B) setVisible(false) C) setVisible() D) None

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

Event class is defined in which of these libraries?


21 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?
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
A________is Componenet that represents a hierarchical view of data
A) JBuuton B) Jtree C) JList D) JCheckbox
24
Which of these events will be generated if we close an applet’s window?
25 A) ActionEvent B) ComponentEvent
C) AdjustmentEvent D)WindowEvent
Default orientation of progress bar is:
26 A) Horizontal B) Vertical C) Left D) Bottom
Panel is used for __________ components
27 A) Muliple B) Single C) Grouping D) both a and b

28 Who invented Java Programming?


A) Guido van Rossum B) James Gosling
C) Dennis Ritchie D) Bjarne Stroustrup
29 Event class is defined in which of these libraries?
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

31 Border Layout is divided into_________regions


A) five B) one C) two D) three
32 Which of these events will be generated if we close an applet’s window?
A) ActionEvent B) Component Event
C) AdjustmentEvent D) Window Event
33 Plugable Look & Feel is the feature of Swing

Positions the componenets into five


34 BorderLayout
regions:east,west,north,south,center

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


38 Container
holds 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


45 The string parameter to the JButton constructor
the button

What letter precedes Swing component names that have a


46 J
corresponding 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