Sanjivani Rural Education Society’s
SANJIVANI K. B. P.
POLYTECHNIC
Department of Computer Technology
KOPARGAON – 423601, DIST: AHMEDNAGAR
2023-2024
Class Test: [Unit I-AWT] Date: /2023
Name: Set: I
Roll No:
1. Give the abbreviation of AWT?
a) Applet Windowing Toolkit b) Abstract Windowing Toolkit
c) Absolute Windowing Toolkit d) None of these
2. How many types of control does AWT support?
a) 7 b) 6 c) 5 d) 8
3. Dialog box does not have minimize and maximize button
a) True b) False
4. Which is a component in AWT that can contain another component like buttons, textfields, labels etc?
a) Window b) Container c) Panel d) Frame
5. Which class provides many methods for graphics programming?
a) java.awt b) java.Graphics c) java.awt.Graphics d) None of these
6.Runnable is
a)Class b) Method c) Variable d) Interface
7. Executable applet is
a). applet file b) .java html c) .java file d) .class file
8. Which method executes only once?
a) start() b) stop() c) init() d) destroy()
9. Applet can be embedded in
a) HTML document b) word document c) gif file d) rtf file
10. Which is the container that doesn’t conatin the title bar and MenuBars.It can have other components like button,
textfield.
a) Window b) Frame c) Panel d) Conatiner
11. Which is a passive AWT control that do not generate any event?
a) Button b) RadioButton c) Choice d) Label
12. The default layout manager of Frame is
a) FlowLayout b) BorderLayout c) GridLayout d) CardLayout
13. Which method is used to check the status of checkbox?
a) getStatus( ) b) getState( ) c) isChecked( ) d) getChecked( )
14. The default layout manager of Applet is
a) FlowLayout b) BorderLayout c) GridLayout d) CardLayout
15. Which of the method is use to output a string in applet?
a) display( ) b) print( ) c) drawString() d) transient( )
16. Which of the following method is used to set a TextComponent to read‐only mode?
a) Editable( ) b) nonEditable( ) c) setEchoChar( ) d) setEditable( )
17. Which of the following generates action events when an item is double‐clicked.
a) List b) Checkbox c) MenuItem d) TextField
18. Which of the following does have its default layout as BorderLayout.
a) Frame b) Dialog c) JApplet d) All of Above
19. Which of the following statement about GUI component is wrong?
a) Swing exists since the version 1.2 of the JD
b) AWT stands for Abstract Window Toolkit
c) You cannot place AWT component on swing container
d) The AWT classes are deprecated.
20.Which of the following package is used for Graphical User Interface?
a) java.applet b) java.awt c) java.awt.image d) java.io
21. What are the variables defined in Dimension?
a) length and width b) height and length c) height and width d) None of these
22. Which AWT component is not editable?
a) Button b) TextField c) FlowLayout d) Label
23. The method places a Menu m into the MenuBar mb.
a) mb.addMenuItem(m) b) mb.addItem(m) c) mb.add(m) d) None of these
24. How many ways can we align the label in a container?
a) 1 b) 2 c) 3 d) 4
25. The title of the frame can be set in AWT using which of the following method?
a) setHeading b) setTitle c) CreateTitle d) Settitle
26.Which of these classes can be added to any container class, using the add method defined in container
class?
a) Button b) CheckboxMenuItem c) Menu d)MenuBar
27.Which of the following methods can be used to change the size of a java.awt.Component object?
a) dimension() b) setSize() c) area() d) size()
28.The most commonly used layout managers are?
a) FlowLayout b) BorderLayout c) GridLayout d) All of these
29.These two ways are used to create a Frame
1.By creating the object of Frame class(association)
2.By extending Frame class (inheritance)
a)True b) False
30. The title of the frame can be set in AWT using the method.
a) setHeading b) setTitle c) createTitle d) settitle
31. Which are passive controls that do not support any interaction with the user?
a) Choice b) List
c) Labels c) Settitle
32. Which abstract class is super class of all the menu related class?
a)MenuComponent b) MenuBar c) MenuItem d) CheckboxMenuItem
33. By which method we can set or change the text in a Label in AWT?
a) setText() b) getText() c) addText() d) all of these
34. Default layout manager for subclasses of window is
a) CardLayout b) BorderLayout c) Frame d) BorderLayout
35. Each menu is associated with a list of menu items:
a) Checkbox b) Drop-down c) Choice d) None of these
36. Which is the immediate super class of Applet?
a) Container b) Component c) Frame d) Panel
37.Which class encapsulates a blank window upon which we can draw?
a) Window b) Frame c) Applet d) Canvas
38.Color class can create object of it using which of the following color values?
a) RGB b) RYB c) CMY d) HSB
39.Which of the following style is not supported by Font class?
a) Font.UNDERLINE b) Font.ITALIC c) Font.PLAIN d) Font.BOLD
40.A class displays a dialog window from which a user can select a file.
a) Dialog b) FileDialog c) File d) None of these
41. A checkbox is a control that consist of a
a) Combination of a small box b) A label
c) Combination of a large box and a label d) Both a & b
42. All AWT controls are subclass of which class?
a) Component b) Container c) AWT Control d) Window
43. Menus can be added to
a) Menus b) menubar c) frame d) both a and b
44. What are the type of dialog box
a) Modal Dialog box b) Modal and Modeless Dialogbox c) Model d) None of these
45. The immediate super class of TextArea is
a) TextField b) TextBox c) TextComponent d) Component
46. Which is the container that doesn’t contain title bar and menu bars. It can have other components like button,
text field etc?
a) Window b) Frame c) Panel d) Container
47. Which object can be constructed to show any number of choices in the visible window?
a) Choice b) Menu c) List d) Checkbox
48. By which method we can set or change the text in a label in AWT?
a) setText() b) getText() c) addText() d) all of these
49. On which side applet always executed?
a) Server side b) Client side
50. The setBackground () method is a part of which of the following class java.awt package?
a) Component b) Applet c) Object d) Graphics
51. Which of the following is true about applet?
a) Applets do not have a main() method.
b)Applets must run under applet viewer or web browser
c)The user I/O is not performed using java’s stream I/O class
d) All of these.
52. Which class is used to represent a single line of text with password character facility
a) TextField b)TextArea c) Label d) Checkbox
53. Java applet are used to create which applications
a) Graphical b) User interactive c) Both a & b d) None of the above
54. Which of these functions is called to display the output of an applet?
a) Display() b)paint() c) displayApplet() d)show()
55. Which of these methods is a part of Abstract Window Toolkit ( AWT )?
a) Display() b) Paint() c) Show() d) All of these .
56. Which method returns currently selected item in choice
a) getSelectedItem() b) getSelectedElement() c) getSelectedIndex d) getItem()
57. In the given constructor what third parameter indicates: Scrollbar s= new Scrollbar(10,20,0,100)?
a) size of thumb b) minimum value c) maximum value d) Initial value
58. The correct hieararchy for panel is
a) Component – Container – Window – Panel
b) Component – Container – Applet – Panel
c) Component – Container – Panel
d) Container – Component – Panel
59. Which component of AWT provides compact multichoice, scrolling component
a) List b)Choice c) Panel d) TextArea
60. What does the following line of code do? TextField tf = new TextField(20);
a) create text object that can hold 20 rows of text
b) create the object text and initializes it with value 20
c) creates text box that can hold 20 columns of text
d) This is invalid code
61. Which method is used to count the number of items in the list?
a) getItem() b) getSelectedItem() c) getItemCount() d) getCount()
62. Panel is defined as
a) The panel class is concrete subclass of Container
b) A panel is a window that does not contain titlebar, menubar and border
c) Panel is super class of Applet
d) All the above
63. Which method is use to set password character for the textfield?
a) setPasswordCharacter()
b) setEchoChar()
c) setPassChar()
d) setEchoCharacter()
All THE BEST