0% found this document useful (0 votes)
47 views7 pages

Question Bank AJP

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
47 views7 pages

Question Bank AJP

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

Q. 1 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) 12 point Times New Roman


(b) 11 point Times New Roman
(c) 10 point Times New Roman
(d) 9 point Times New Roman

Q. 2 Which of the method can be used to output a String in an Applet?


(a) display( )
(b) print( )
(c) drawString( )
(d) transient( )

Q.3 What is use of second parameter in given constructor Lable(String,int)


(a) specifies height of label
(b) specifies width of label in terms of pixel
(c) specifies the alignment of text in label in terms of pixel
(d) specifies width of label

Q. 4 A ____________ is a passive AWT control that do not generate any event?


(a) Button
(b) RadioButton
(c) Choice
(d) Label

Q. 5 Which of the following method is used to set a TextComponent to read‐only


mode?
(a) Editable( )
(b) nonEditable( )
(c) setEchoChar( )
(d) setEditable( )

Q. 6 Which AWT component is not editable?


(a) Button
(b) TextField
(c) FlowLayout
(d) Label

Q. 7 Which Text Component method is used to set a TextComponent to the read‐


only state?
(a) Editable
(b) NonEditable
(c) setEchoChar
(d) setEditable

Q. 8 What is use of second parameter in given constructor Lable(String,int)


(a) specifies height of label
(b) specifies width of label in terms of pixel
(c) specifies the alignment of text in label in terms of pixel
(d) specifies width of label

Q. 9 ___________ positions are the components into 5 regions east, west, south,
north, center.
(a) CardLayout
(b) BorderLayout
(c) GridLayout
(d) FlowLayout

Q. 10 Which object can be constructed to show any number of choices in the


visible window?
(a) Labels
(b) Choice
(c) List
(d) Checkbox

Q.11 Which method is used to set password character for a TextField?


(a) setPasswordCharacter( )
(b) setEchoChar( )
(c) setPassChar( )
(d) setEchoCharacter( )

Q.12 Frame is a standard window, which is __________ of Window class from


AWT hierarchy?
(a) Derived class / Subclass
(b) Base class / Super class
(c) Root class
(d) Family class

Q.13 Which of the following does not have its default layout as BorderLayout.
(a) Frame
(b) Dialog
(c) JApplet
(d) All of Above

Q14 Which of the following statement about GUI component is wrong?


(a) swing exists since the version 1 of the JDK
(b) AWT stands for Abstract Window Toolkit
(c) You cannot place AWT component on swing container.
(d) The AWT classes are deprecated.

Q.15 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

Q.16The following specifies the advantages of It is lightweight. It supports


pluggable look and feel. It follows MVC (Model View Controller) architecture.

(a) Swing
(b) AWT

(c) Both A & B

(d) None of the above

Q.17 Which package is used for import the swing components?


(a) java
(b) java
(c) javax
(d) All of the above

Q.18 In swing, Buttons are subclasses of which class?


(a) AbstractButton
(b) JButton (
c) Button
(d) JRadioButton

Q.19 Which of the following is not constructor of JTree?


(a) JTree(TreeNode tn)
(b) JTree(Vector v)
(c) JTree(int x)
(d) none of the above

20 What is purpose of JTree?


(a) To show data in form of parent and child nodes.
(b) To show data in list view.
(c) To show data in tabular form.
(d) To show data in menu‐bar.

21 Which of the following method is not applicable for Button in swing.


(a) setDiableIcon( )
(b) setPressedIcon( )
(c) setSelectedIcon( )
(d) setRollOverIcon( )

Q.22 ComponentEvent is the superclass of________


(a) ActionEvent
(b) ItemEvent
(c) TextEvent
(d) All of above

Q.23 Which class is used for this processing method processActionEvent( )


method?
(a) Button, List, MenuItem
(b) Button,Checkbox,Choice
(c) ScrollBar, Component, Button
(d) None of the above.

Q.24 Button Control implements following listener interface.


(a) ItemListener
(b) ActionListener
(c) FlowListener
(d) Adapter
Q.25 What value is returned by the readLine( ) method when it reach at End of
File?
(a) EOF
(b) null
(c) 0
(d) END

You might also like