Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
384 views

Class Test Question Bank: Subject: Advance Java Subject Code: 22517

1. The document contains a question bank with 30 multiple choice questions related to advance Java topics like AWT, event handling, layout managers, and Swing components. 2. The questions cover concepts like commonly used AWT component methods, event handling using listeners, AWT abbreviations, graphics drawing methods, text component usage, container components, passive vs interactive controls, and layout manager usage. 3. The document provides answers to test knowledge of core Java GUI and event handling concepts as well as AWT vs Swing differences.

Uploaded by

114-Lobhan Patil
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
384 views

Class Test Question Bank: Subject: Advance Java Subject Code: 22517

1. The document contains a question bank with 30 multiple choice questions related to advance Java topics like AWT, event handling, layout managers, and Swing components. 2. The questions cover concepts like commonly used AWT component methods, event handling using listeners, AWT abbreviations, graphics drawing methods, text component usage, container components, passive vs interactive controls, and layout manager usage. 3. The document provides answers to test knowledge of core Java GUI and event handling concepts as well as AWT vs Swing differences.

Uploaded by

114-Lobhan Patil
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Class Test Question Bank

Subject: Advance Java Subject Code: 22517

1) Where are the following four methods commonly used?


1) public void add(Component c)
2) public void setSize(int width,int height)
3) public void setLayout(LayoutManager m)
4) public void setVisible(boolean)

a. Graphics class
b. Component class
c. Both A & B
d. None of the above

2) Implement the Listener interface and overrides its methods is required to perform
in event handling.
a. True
b. False

3) Give the abbreviation of AWT?


a. Applet Windowing Toolkit
b. Abstract Windowing Toolkit
c. Absolute Windowing Toolkit
d. None of the above

4) In Graphics class which method is used to draws a rectangle with the specified
width and height?
a. public void drawRect(int x, int y, int width, int height)
b. public abstract void fillRect(int x, int y, int width, int height)
c. public abstract void drawLine(int x1, int y1, int x2, int y2)
d. public abstract void drawOval(int x, int y, int width, int height)

5) Which method can set or change the text in a Label?


a. setText()
b. getText()
c. All the above
d. None of the above

6) Which is a component in AWT that can contain another components like buttons,
textfields, labels etc.?
a. Window
b. Container
c. Panel
d. Frame

7) The ActionListener interface is not used for handling action events.


a. True
b. False
8) Which are passive controls that do not support any interaction with the user?
a. Choice
b. List
c. Labels
d. Checkbox

9) How many types of controls does AWT support?


a. 7
b. 6
c. 5
d. 8

9) Which package provides many event classes and Listener interfaces for event
handling?
a. java.awt
b. java.awt.Graphics
c. java.awt.event
d. None of the above

10) The Following steps are required to perform


1) Implement the Listener interface and overrides its methods
2) Register the component with the Listener
a. Exception Handling
b. String Handling
c. Event Handling
d. None of the above

11) Which class provides many methods for graphics programming?


a. java.awt
b. java.Graphics
c. java.awt.Graphics
d. None of the above

12) AWT components are


a. Platform dependent
b. Platform Independent
c. Both A & B
d. None of Above

13) The size of a frame on the screen is measured in ______.


a. Inches
b. Dots
c. Nits
d. Pixels

14) Swing have more components than AWT.


a. True
b. False
15) setBackground() method to set the background color for ____?
a. Component
b. Container
c. JComponent
d. None of Above

16) Which statement creates a Text Area with 10 rows and 20 columns?
a. TextArea text = new TextArea(10,20);
b. TextArea text = new TextArea(20,10);
c. TextArea text = new TextArea(200);
d. None of Above

17) How many line input takes from user in Text Field in AWT.
a. 3
b. 2
c. 1
d. None of Above

18) Using which component user can implement radiobutton in AWT?


a. Checkbox with CheckboxGroup
b. Only Checkbox
c. RadioButton
d. JRadioButton

19) Layout manager is used to


a. Add component to Layout
b. Arrage components in particular manner
c. Both A & B
d. None of Above

20) In which layout only one component visible at a time?


a. FlowLayout
b. GridLayout
c. BorderLayout
d. CardLayout

21) Which layout is used to arrage components in a line left to right on after another?
a. FlowLayout
b. GridLayout
c. BorderLayout
d. CardLayout

22) _________ component provides to show various dialog such as error, user
specific message, confirmation etc.
a. JDialogBox
b. JFileChooser
c. Jtable
d. JOptionPane
23) Which of following interface define a method itemStateChanged()?
a. ActionListener
b. ItemListener
c. MouseListener
d. ComponentListener

24) Which of following interfaces define a method actionPerformed()?


a. ContainerListener
b. ItemListener
c. ActionListener
d. MouseListener

25) Which of following method is defined in MouseMotionAdapter class?


a. mousePressed()
b. mouseClicked()
c. mouseDragged()
d. mouseReleased()

26) Which event will be notified if scroll bar is manipulated?


a. AdjustmentEvent
b. WindowEvent
c. ComponentEvent
d. ActionEvent

27) Which of the methods are used to register a mouse motion listener?
a. addMouse()
b. addMouseListener()
c. addMouseMotionListner()
d. None of Above

28) Which of following event generate when checkbox is clicked?


a. CheckBoxEvent
b. ItemPressEvent
c. ItemEvent
d. ClickEvent

29) Which of these events will be generated if we close an applet’s window?


a. ActionEvent
b. ComponentEvent
c. AdjustmentEvent
d. WindowEvent

30) Which of following event generate when button is pressed?


a. WindowEvent
b. ActionEvent
c. PressEvent
d. ButtonEvent

***** ALL THE BEST *****

You might also like