1.AWT

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 5

1.

AWT
1. The CheckboxGroup class is a subclass of the Component class.
 True
 False

2. Which is passive control that do not support any interaction with


the user?
 Choice
 List
 Labels
 Checkbox

3. AWT has more powerful components like tables, lists, scroll


panes, color chooser, tabbed pane etc.
 True
 False

4. Applet can be embedded in _____________.


 HTML document
 word document
 gif file
 rtf file

5. Which method of the Applet class displays the result of applet


code on screen ?
 run() method
 paint() method
 drawString() method
 main() method

6. Which object can be constructed to show any number of choices in


the visible window?
 Labels
 Choice
 List
 Checkbox

7. Which method can set or change the text in a Label?


 setText()
 getText()
 All the above
 None of the above

8. Which is the container that doesn't contain titlebar and MenuBars.


It can have other components like button, textfield etc ?*
 Window
 Frame
 Panel
 Container

9. These two ways are used to create a Frame 1) By creating the


object of Frame class (association) 2) By extending Frame class
(inheritance)
 True
 False

10. Which of the following are acceptable? ( Choose two) 1)


Object o = new Button(""A""); 2) Boolean flag = true; 3)
Panel p = new Frame(); 4) Frame f = new Panel(); 5) Panel p
= new Applet();
 1 and 5
 1 and 2
 1 and 3
 1 and 4

11. AWT stands for___


 Applet Windowing Toolkit
 Abstract Windowing Toolkit
 Absolute Windowing Toolkit
 None of the above

12. Which class provides many methods for graphics


programming?
 java.awt
 java.Graphics
 java.awt.Graphics
 None of these

13.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)
 Graphics class
 Component class
 Both A & B
 None of the above

14. Which of the following is true about applet ?


 Applets do not have main() method
 Applets must run under appletviewer or web browser
 The user I/O is not performed using Java's stream I/O class
 all of these
15. Which is the container that doesn't contain title bar and
MenuBars but it can have other components like button,
textfield etc?
 Window
 Frame
 Panel
 Container
16. Which is used to store data and partial results, as well as to
perform dynamic linking, return values for methods, and
dispatch exceptions?
 Window
 Panel
 Frame
 Container

17. By which method we can set or change the text in a Label


in AWT?
 setText()
 getText()
 addText()
 all of these

18. Which is a component in AWT that can contain another


components like buttons, textfields, labels etc.?
 Window
 Container
 Panel
 Frame

19. Which of the following statements are true? a) The default


layout manager for an Applet is FlowLayout b) The default
layout manager for an application is FlowLayout c) A layout
manager must be assigned to an Applet before the setSize
method is called d) The FlowLayout manager attempts to
honor the preferred size of any components
 a
 b
 c
 a and d
20. Which of the following may a menu contain?a) A separator
b) A check box c) A menuitem d) A button
 a
 b
 c
 a and c

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy