Assingment 1 of Ajp
Assingment 1 of Ajp
Assignment No:1
Q. 2 Which is the container that contain title bar and can have MenuBars. It can have other
components like button, textfield etc.?
(a) True
(b) False
Q. 6 These two ways are used to create a Frame By creating the object of Frame class (association)
By extending Frame class (inheritance)
(a) True
(b) False
Q. 7 Which is the container that doesn't contain title bar and MenuBars. It can have other
components like button, textfield etc?
(a) Window
(b) Frame
(c) Panel
(d) Container
Q. 8 How many types of controls does AWT supports these controls are subclasses of component?
(a) 7 (b) 6
(c) 5 (d) 8
Q. 9 Which are passive controls that do not support any interaction with the user?
(a) inheritance
(b) association
(c) Both A & B
(d) None of the above
Q. 15 AWT more powerful components like tables, lists, scroll panes, color chooser, tabbed pane etc.?
Q. 17 In Graphics class which method is used to draws a rectangle with the specified width and
height?
Q. 18 Implement the Listener interface and overrides its methods is required to perform in event
handling?
(a) True (b) False
(c) ComponentMenu
(d) MenuBar
(a) AWT components creates a process where as swing components creates a thread
(b) AWT components creates a thread where as swing components creates a process
(c) Both AWT and Swing components creates a process
(d) Both AWT and swing components creates a thread
(a) GridLayout(int a)
(b) GridLayout(int num_rows, int num_columns)
(c) GridLayout(int rows, int cols, int vert)
(d) GridLayout(int hor)
Q. 29 Which class is used to represent a single line textbox with password character facility?
Q. 31 Suppose a Panel is added to a Frame and a Button is added to the Panel. If the Frame’s font is
set to 12 point Times New Roman, the panel’s font is set 10 points Times New Roman and the Button’s
font is not set. What font will be used to display the Button’s label?
(a) FlowLayout can use multiple rows if the horizontal space in the container is too small to hold
the component.
(b) FlowLayout is the default layout manager of panel and applet.
(c) It is the default layout manager for window.
(d) Both A & B.
String in an Applet?
(a) setPasswordCharacter( )
(b) setEchoChar( )
(c) setPassChar( )
(d) setEchoCharacter( )
(a) JApplet
(b) JFrame
(c) JButton
(d) None of these
Q. 41 Which class defines setSize( ) method?
(a) Frame
(b) Applet
(c) Component
(d) Panel
(a) TextField
(b) JTextField
(c) EditTextField
(d) TextArea
Q. 43 Which Text Component method is used to set a TextComponent to the read‐only state?
(a) Editable
(b) NonEditable
(c) setEchoChar
(d) setEditable
Q. 44 How would you set the color of graphics context called g to cyan?
(a) g.setColor(“cyan”);
(b) g.setCurrentColor(cyan);
(c) g.setColor(“Color.cyan”);
(d) g.setColor(Color.cyan);
Q. 46 The setBackground() method is part of which of the following class java.awt package?
Q. 47 What does the following line of code do? TextField tf = new TextField(10);
Q. 48 Frame is a standard window, which is __________ of Window class from AWT hierarchy?