You are on page 1of 12

1.

JPanel and Applet use Text(non-editable)


___________________ as their default
layout
9. A ScrollPane is _______________
FlowLayout
Container

2. Which are various AWT controls


from following? 10. A superclass of Textfield and
TextArea classes that is used to
create single-line , multiline
Labels, Push buttons, Check
textfieldsrexpectively is_____.
boxes, Choice lists.
Textcomponent
3. Which of the following
component class cannot be add
11. A _______ is a component that
on applet
appears as a group of folders in a
Menu file cabinet.

JTabbedPane
4. A checkbox is a control that
consists of a ____________
12. A __________ automatically
arranges the components added
Combination of a small box
and a Label to a container.

Layout Manager
5. A Frame's _______________
designates the area of the frame
13. A ____________ is a passive AWT
excluding the title,menu bar and
control which do not generate
the border.
any event.
ContentPane
Label

6. A GUI stands for _____________.


14. A ____________________component is
stands for Graphical User a display area for a short string
Interface of text, image or both.

Jlabel
7. A JCheckBoxMenuItem is a
subclass of ________.

All of these 15. All Component on Container can


be removed by calling following
method
8. A label is a simple control which
is used to display removeAll()
_________________on the window
16. All swing component classes are 24. AWTEvent Class is define in
placed in following package

javax.swing java.awt

17. An Applet is ______________ of Panel 25. A________isComponenet that


represents a hierarchical view of
subclass data

Jtree
18. Applet Container is used to
prepare ________________output
window. 26. A____________ is component that
presents a rectangular area in
Both a and b which a component may be
viewed

19. AppletViewer tool is available in Scroll Pane


which of the folder of JDK

bin 27. Border Layout is divided


into_________regions

20. Arranges the components as a five


deck of cards such that only one
component is visible at a time
28. BorderLayout class has
CardLayout __________regions to add
components to it

21. At the top of the AWT hierarchy Five


is the__________________ class.

Component 29. By default flowlayout uses


__________justification.

22. AWT classes are contained in the Center


__________ package

java.awt 30. By default page-up and page-


down increment of scrollbar
is_____________.
23. AWT is used for creating a GUI in
Java. AWT stands for 10

Abstract Window Toolkit


31. By default the Frame has a
________________________________
Titlebar,borders,resizing
corners 40. Container is the sub class of?

32. By default which layout manager Component


is set on applet

FlowLayout 41. Control not support by awt are

TabbedPane,Table
33. By which method You can set or
change the text in a Label?
42. Current text of label can be
setText() obtained using ___________________.

getText ()
34. Canvas is a ________________

Window 43. Deafult layout manager for


Frame is ___________________.

35. Checkable menu items are BorderLayout


created using object of
…………………….class.
44. Default layout manager for panel
CheckboxMenuItem is

FlowLayout
36. Choose the incorrect statement

BorderLayout b = new 45. Default layout manager for


BorderLayout(3,4); Window is

Borderlayout
37. Combobox is a combination of
________________________
46. Default Layout of Frame
TextField and Dropdown List
BorderLayout

38. Components are added to which


pane of swing JApplet . 47. Default orientation of progress
bar is:
ContentPane
Horizontal

39. constructors of Jseparator are


48. Double-buffering built in, tool
bothi and ii tips, dockable tool bars,
keyboard accelerators, custom 56. For adding controls to a window,
cursors, etc. are new features of we use following method
_______?
add()
Swing

49. Each menu is associated with a 57. for using Swing control one must
___________list of menu items import______________________________
pacakge
Drop-down
import javax.swing.*

50. Every layout manager is an


instance of __________. 58. Frame is a standard
window,which is
theLayoutManager interface ____________________of Window
class from AWT hierarchy

51. Executable applet is nothing but sub class


_________ file of applet

.class 59. getContentPane() method of


which class

52. FileDialog is which kind of dialog JApplet


box?

Modaltype 60. getSelectedCheckbox() mehod of


which class

53. FlowLayout arranges CheckboxGroup


components from

Left to Right 61. How can the Checkbox class be


used to create a radio button in
AWT?
54. FlowLayout does not support
this value of alignment… By associating Checkbox
objects with a CheckboxGroup
FlowLayout.BASELINE

62. How do you change the current


55. Font class is available in layout managers for a container?
___________
Use the setLayout() method
java.awt package

63. How many checkboxes we can


check at a time:
71. In FlowLayout manager the
multiple default space between each
component is

64. How To Apply Image To Button ? 5 Pixel

Using ImageIcon
72. In Graphics class Which method
is used to set the graphics
65. How would you set the color of a current color to the specified
graphics context called g to cyan? color?

g.setColor(Color.cyan); public abstract void


setColor(Color c)

66. Identify the correct constructor


of Font class? 73. In how many ways we can define
the scrollbar?
Font( String name,
intfontstyle,intpointsize) All of the above

67. Identify wrong constructor of 74. In Swing Buttons are the


Checkbox subclasses of which class?

None of Above AbstractButton

75. In Swing the content pane can be


68. In applet, which of the following obtained via method________
tag is used for accepting user
defined parameter? getContentPane()

Param
76. In Swing ____________is a
component that displays rows
69. In AWT Checkbox class is used to and columns of data.
create __________
table
Checkbox and Radio buttons

70. In AWT Radio buttons are


created using_____________________ 77. In Swing, tables are implemented
by the ______________ class
CheckBoxGroup
JTable
78. Indentify which is a valid 86. List can be created for multiple
constructor of MenuItem class? selection by using following
constructor.
MenuItem(String Itemname)
List(intnum,booleanmultiselec
t)
79. Items are added in JComboBox
using method……?
87. Model is the _________ of the MVC
addItem() architecture.

bottom most level


80. JApplet class is Derived form

Applet 88. mouse click will always generate


________________ event?

81. Java supports input/output of MouseEvent


data through the classes included
in the _______ package:
89. MutableTreeNode is
Java.io extends__________________interface

TreeNode
82. JCheckBox is
_______________________Component
90. MVC Architecture is
lightweight
Model-View-Controller
83. JRadioButton is a subclass of
________.
91. Name the class used to represent
AbstractButton a GUI application window, which
is optionally resizable and can
have a title bar, an icon, and
84. JTabbedPane class is present in menus
which package?
Frame
javax.swing

92. On which side applet always


85. Jtree class comes under which executed?
package
Client side
javax.swing

93. Package of drawString() method


is
java.awt 101. Select the proper
constructor of FileDialog

94. Panel is defined as FileDialog(Frame parent,


String boxName)
All of above

102. Select the proper syntax


95. Panel is used for __________ to addcomponent in an applet
components
Component add(Component
Grouping comoObj)

103. setBorder() method is


used to set a border for ________?
96. Plugable Look & Feel is the
feature of Jcomponent

Swing
104. setMenuBar() method of
which class
97. Positions the componenets into
five Frame
regions:east,west,north,south,ce
nter

BorderLayout
105. State true of false i) AWT
is an extended version of swing
98. Program which executes applet ii) Paint( ) of Applet class cannot
is known as________ be overridden

Appletviewer i-false, ii-false

106. Swing components are


99. public class MenuBar extends
____________________ lightweight and platform
independent
MenuComponent

107. swing is the set of


100. Scrollbar( ) creates a ____________ that provides more
______________ scroll bar by default. powerful & flexible components
as compare to AWT.
Vertical
Classes
108. Text field usually called as

edit control 115. The coordinate of the


upper-left corner of a frame is
________.
109. TextField class is used
for__________ (0, 0)

Single-Line text-entry area


116. The correct hierchy for
panel is
110. The Applet class is in
………..package Component-Container-Panel

java.applet
117. The default layout
manager for the content pane of
111. The AWT container is an a swing based applet is
instance of the ___________ class
which holds various components Border-Layout
and other containers

Container 118. The following specifies


the advantages of It is
lightweight. It supports
112. The CardLayout class pluggable look and feel. It follows
defines the following MVC (Model View Controller)
constructors: architecture.

CardLayout() // First Swing


Cardlayout(inthor, intver)
//second
119. The method drawRect() is
used to display an
113. The CardLayout class ___________________________
manages the components in such
a manner that outlined rectangle
____________component is visible at
a time
120. The method setLabel can
Only one be used with what type of Object
?

114. The concept of the menu TextField.


bar canbe implemented by using
three java classes—
121. The method ____gets the
All of these text of the button jtb is
tells what text will appear on
jtb.getText( ) the button

122. the method _________


places a menu mu into a menu
bar mb. 128. The Swing component
classes that are used in
mb.add(mu) encapsulate a mutually exclusive
set of buttons are?

123. The method ______________ ButtonGroup


sets the foreground color to
yellow in Jframe

f.setForeground 129. The syntax for drawRect()


(Color.YELLOW) method is

drawRect(int top, int left, int


width, int height)
124. The method
_______________creates a IconImage
for file c:\image\us.gif

newImageIcon("c:\imag 130. The TextArea controls


e\us.gif"); create a ________ respectively.

Multi-line text

125. The method


____________________gets the text (or 131. the various Control
caption) of the label jlbl Supported by AWT are

jlbl.getText() All of these

132. The various controls


supported by swing are:
126. The setBackground()
method is part of the following all of the above
class in java.awt package:

Component
133. The __________ arranges
components in rows and
columns and makes all
127. The string parameter to components the same size.
the JButton constructor
GridLayout manager
140. To display text on the
applet ______ method is used.
134. The ___________ interface is
used to handle button events:
drawString()
ActionListener

141. To draw a line in applet,


we use following method
135. The _____________ class is
used to create radio button in drawLine()
AWT

CheckboxGroup
142. To fetch caption of
button___________ method is used.
136. The ___________________ Can getLabel( )
be used to enter or display a
string

textfield
143. To retrieve the current
state of a check box,call
___________________
137. These four methods getState()
commonly used in? 1)public void
add(Component c) 2)public void
setSize(intwidth,int height)
3)public void
144. To set title to the frame
setLayout(LayoutManager m)
window___________ method is
4)public void setVisible(boolean)
used.
Component class
voidsetTitle(String str)

145. We can add menus to


138. To create window with _________________________
title bar which of the following
class is used? Frames

Frame
146. What are controls or
components?
139. To create file dialog box
______________ class is used Controls or components allow
users to interact with
FileDialog application
154. what is default layout
manager for panels and applets

147. What are the FlowLayout


TextCompoent ?

TextField , TextArea
155. What is the default layout
for a dialog?
148. What Are The Types of
Dialogbox ? BorderLayout
modal and Modeless Dialogbox

149. What are the variables 156. What is the difference


defined in Dimension between a TextArea and a
TextField?
height and width
A TextArea can handle
multiple lines of text
150. What Checkbox method
allows you to tell if a Checkbox is
checked? 157. What is the minimum and
maximum of JProgressBar
getState()
minimum -0 Maximum -100

158. What is the use of


151. What does the following following method in JDialog?
line of code do? TextField text = Container getContentPane()
new TextField(10);
This method returns,a Content
Creates text object that can Pane for the JDialog.
hold 10 columns of text.

159. What is use of 3rd


152. What is API parameter in given constructor
Scrollbar(int,int,int,int,int)
Application Programming
Interface Thumbsize

153. What is default alignment


160. What is use of second
of components using FlowLayout
parameter in given constructor
FlowLayout.CENTER
Label(String,int)

sepcifies the alignment of text


in label in terms of pixel
161. what layout manager
should you use so that every
component occupies the same
size in the container?

GridLayout

162. What letter precedes


Swing component names that
have a corresponding AWT
component?

You might also like