Ajp 22517 Important Questions
Ajp 22517 Important Questions
48. are new features of ?" 61. How can the Checkbox class be
Ans: Swing used to create a radio button in
49. Each menu is associated with a AWT?
list of menu items Ans: By associating Checkbox
Ans: Drop-down objects with a CheckboxGroup
50. Every layout manager is an instance 62. How do you change the current
of . layout managers for a container?
Ans: the LayoutManager interface Ans: Use the setLayout() method
51. Executable applet is nothing but 63. How many checkboxes we can
file of applet check at a time:
Ans:.class Ans: multiple
52. FileDialog is which kind of dialog 64. How To Apply Image To Button ?
box? Ans: Using ImageIcon
Ans: Modaltype 65. How would you set the color of a
53. FlowLayout arranges components graphics context called g to cyan?
from Ans: g.setColor(Color.cyan);
Ans: Left to Right 66. Identify the correct constructor of
54. FlowLayout does not support this Font class?
value of alignment… Ans: Font( String name, int
Ans: FlowLayout.BASELINE fontstyle,int pointsize)
55. Font class is available in 67. Identify wrong constructor of
Checkbox
Ans: java.awt package Ans: ?????
56. For adding controls to a window, 68. In applet, which of the following
we use following method tag is used for accepting user
Ans: add() defined parameter?
57. for using Swing control one must Ans: Param
import 69. In AWT Checkbox class is used to
pacakge create
Ans: import javax.swing.* Ans: Checkbox and Radio buttons
58. Frame is a standard window,which 70. In AWT Radio buttons are created
is of using
Window class from AWT hierarchy Ans: CheckBoxGroup
Ans: sub class 71. In FlowLayout manager the default
59. getContentPane() method of which space between each component is
class Ans: 5 Pixel
Ans: JApplet 72. In Graphics class Which method is
60. getSelectedCheckbox() mehod of used to set the graphics current
which class color to the specified color?
Ans: CheckboxGroup Ans: public abstract void
setColor(Color c)
Important Year: 2021-22
73. In how many ways we can define 86. List can be created for multiple
the scrollbar? selection by using following
Ans: ????? constructor.
74. In Swing Buttons are the subclasses Ans: List(int num,boolean
of which class? multiselect)
Ans: AbstractButton 87. Model is the of the MVC
75. In Swing the content pane can be architecture.
obtained via method Ans: bottom most level
Ans: getContentPane() 88. mouse click will always generate
76. In Swing is a event?
component that displays rows and Ans: MouseEvent
columns of data. 89. MutableTreeNode is
Ans: table extends interfa
77. In Swing, tables are implemented ce
by the class Ans: TreeNode
Ans: JTable 90. MVC Architecture is
78. Indentify which is a valid Ans: Model-View-Controller
constructor of MenuItem class? 91. "Name the class used to represent a
Ans: MenuItem(String Itemname) GUI application window, which is
79. Items are added in JComboBox optionally resizable and can have a
using method……? title bar, an icon, and menus"
Ans: addItem() Ans: Frame
80. JApplet class is Derived form 92. On which side applet always
Ans: Applet executed?
81. Java supports input/output of data Ans: Client side
through the classes included in the 93. Package of drawString() method is
package: Ans: java.awt
Ans: Java.io 94. Panel is defined as
82. JCheckBox is Ans: All of above
Compon 95. Panel is used for
ent components
Ans: lightweight Ans: Grouping
83. JRadioButton is a subclass of 96. Plugable Look & Feel is the feature
. of
Ans: AbstractButton Ans: Swing
84. JTabbedPane class is present in 97. Positions the componenets into five
which package? regions: east, west, north, south,
Ans: javax.swing center
85. Jtree class comes under which Ans: BorderLayout
package 98. Program which executes applet is
Ans: javax.swing known as
Important Year: 2021-22
121. The method setLabel can be used 131. The TextArea controls create a
with what type of Object ? respectively.
Ans: TextField. Ans: Multi-line text
122. The method gets the text of 132. the various Control Supported by
the button jtb is AWT are
Ans: jtb.getText( ) Ans: ?????
123. the method places a 133. The various controls supported by
menu mu into a menu bar mb. swing are:
Ans: mb.add(mu) Ans: ?????
124. The method sets 134. The arranges
the foreground color to yellow in components in rows and columns
Jframe and makes all components the
Ans: f.setForeground same size.
(Color.YELLOW) Ans: GridLayout manager
125. The method 135. The interface is used
creates a to handle button events:
IconImage for file c:\image\us.gif Ans: ActionListener
Ans: new 136. The class is used to
ImageIcon("c:\image\us.gif&q create radio button in AWT
uot;); Ans: CheckboxGroup
126. The method 137. The Can be
gets the text used to enter or display a string
(or caption) of the label jlbl Ans: textfield
Ans: jlbl.getText() 138. "These four methods commonly
127. The setBackground() method is used in? 1)public void
part of the following class in add(Component c) 2)public void
java.awt package: setSize(int width,int height)
Ans: Component 3)public void
128. The string parameter to the JButton setLayout(LayoutManager m)
constructor tells 4)public void setVisible(boolean)"
Ans: what text will appear on the Ans: Component class
button 139. To create window with title bar
129. The Swing component classes that which of the following class is
are used in encapsulate a mutually used?
exclusive set of buttons are? Ans: Frame
Ans: ButtonGroup 140. To create file dialog box
130. The syntax for drawRect() method class is used
is Ans: FileDialog
Ans: drawRect(int top, int left, int 141. To display text on the applet
width, int height) method is used.
Ans: drawString()
Important Year: 2021-22
259. Which of the following statements 270. Which of these methods cannot be
is for placing the frames upper left called on JLabel object?
corner to (200,100)? Ans: setBorderLayout()
Ans: frame.setLocation(200,100) 271. Which of these methods cannot be
260. Which of the following swing called on TextArea?
components donot have an Icon Ans: String getItem(int index)
parameter in its constructor? 272. Which of these methods is used to
Ans: JTextField setting the winwods dimension
261. Which of the follwing is Ans: void setSize(Dimension
constructor of Jtable? new_size)
Ans: JTable(Object data[][], Object 273. which of these methods use in
colHeads[]) cardlayout
262. Which of the method can be used Ans: add(String s, Component c)
to output a string in an applet? 274. Which of these package is used for
Ans: drawString() graphical user interface ?
263. Which of the method Choice class Ans: java.awt
returns a string containing the 275. Which of these packages contains
name of the item. all the classes and methods
Ans: String getSelectedItem() required for event handling in Java?
264. Which of the subclasses of Ans: java.awt.event
java.awt.component? 276. Which one is the valid constructor
Ans: Container classes of JCheckBox.
265. Which Of these Compenent can be Ans: JCheckBox(Sting s, Icon I,
added to frame? Boolean State)
Ans: ????? 277. Which one method is used to set
266. Which of these following is not a the visibility of the frame?
component of swing Ans: setVisible(true)
Ans: List 278. Which package use for import the
267. Which of these method cannot be swing components?
called on JLabel object? Ans: javax.swing.*;
Ans: setBorderLayout() 279. Which TextComponent method is
268. Which of these methods can be used to set a TextComponent to the
used to obtain the reference to the read-only state?
container that generated a Ans: setEditable
ContainerEvent? 280. which type of button is belongs to a
Ans: getContainer() group such that only one button in
269. Which of these methods can be the group may be selected at one
used to output a string in an time?
applet? Ans: CheckboxGroup
Ans: drawString() 281. Which of these events is generated
when a button is pressed?
Important Year: 2021-22
Ans: FlowLayout
311. class
encapsulates AWT events.
Ans: AWTEvent
312. Constructs a new scroll bar with
the specified orientation.
Ans: Scrollbar(int)
313. component may have different size
rows may have different number of
columns.
Ans: GridLayout
314. method is used to append the
string str to end of the current text.
Ans: append ()
315. method is used to add a tab to the
pane.