Ajpr (QB) 1
Ajpr (QB) 1
a) Component b) Panel
c) Menucomponent d) List
2. What are the controls or componenets?
a) Controls or componenets allow users to interact with application.
b) Controls or componenets do not allow users to interact with users.
c) Controls or componenets allow users to interact with users.
d) Controls or componenets allow application to interact with users
14. -------- method can be used to determine the type of adjustment event .
a) getType() b) getEventType()
c) getAdjustmentType() d) getEventObjectType()
16. Which of the packages contains all of the event handling interfaces ?
a)java.lang b)java.awt
c)java.awt.event d)java.event
Which is the container that contain title bar and can have MenuBars. It can have other
components like button, textfield etc.?
[A] Panel
[B] Frame
[C] Window
[D] Container
.Which is a component in AWT that can contain another components like buttons, textfields,
labels etc.?
[A] Window
[B] Container
[C] Panel
[D] Frame
.The 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
.Swing is not a part of JFC (Java Foundation Classes) that is used to create GUI application?
[A] True
[B] False
41.Which class provides many methods for graphics programming?
[A] java.awt
[B] java.Graphics
[C] java.awt.Graphics
[D] None of the above
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
.The Following steps are required to perform 1) Implement the Listener interface and
overrides its methods 2) Register the component with the Listener
[A] Exception Handling
[B] String Handling
[C] Event Handling
[D] None of the above
Pass a X/Y
North, Assign a percentage Do nothing, the
South,East,West. row/column FlowLayout will
parameter to the
grid add method. position the
reference component.
Which of the following creates a List with 5 visible items and multiple selection
enabled?
a) new List(5, true)
b) new List(true, 5)
c) new List(5, false)
d) new List(false,5)
53) An Applet has its Layout Manager set to the default of FlowLayout. What code
would be the correct to change to another Layout Manager?
a) setLayoutManager(new GridLayout());
b) setLayout(new GridLayout(2,2));
c) setGridLayout(2,2,))
d setBorderLayout();
A. MVC
B. MVP
C. Layered architecture
D. Master-Slave architecture
Which language is used in the swing framework?
A. JavaScript
B. Java
C. React
D. Python
A. Heavyweight
B. Lightweight
C. Mediumweight
D. smallweight
A. Event adapter
B. Event Handler
C. layout manager
D. Grid Manager
Which of these events will be generated if we close ActionEvent ComponentE Adjustment WindowEvent
an applet’s window? vent Event
Which of these events is generated when the size of
ComponentEv ContainerEve FocusEvent InputEvent
a component is changed?
ent nt
Which of these events is generated when the
ComponentEv ContainerEve FocusEvent InputEvent
component is added or removed?
ent nt
}
(a) RadioButtons.
(b) Checkbox and CheckboxGroup.
(c) CheckboxGroup.
(d) CheckBoxGroup.
import java.awt.*;
import java.applet.*; /*
<applet code="MouseEvents" width=300 height=100>
</applet>
*/
mouseX = 0;
mouseY=10;
msg = "Mouse entered.";
repaint();
}
public void mouseExited(MouseEvent me)
{
mouseX = 0;
mouseY = 10;
msg = "Mouse exited.";
repaint ();
}
(a) addMouseListener(this);
(b) addMouseListener(this);
addMouseMotionListener(this);
import java.awt.event.*;
(c)addMouseListener();
(d) All of above..
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
/*
<applet code="SimpleKey" width=300 height=100>
</applet>
*/
public class SimpleKey extends Applet
implements KeyListener
{
String msg = "";
int X = 10, Y = 20; // output coordinates
public void init()
{
addKeyListener(this);
requestFocus(); // request input focus
}
public void keyPressed(KeyEvent ke)
{
showStatus("Key Down");
}
public void keyReleased(KeyEvent ke)
{
showStatus("Key Up");
}
public void keyTyped(KeyEvent ke)
{
msg += ke.getKeyChar();
repaint();
}
// Display keystrokes.
public void paint(Graphics g)
{
g.drawString(X, Y)
}
24.Which of these constant value will change when the button at the end of the
scroll bar was clicked to increase its value?
(a)BLOCK_DECREMENT (b)BLOCK_INCREMENT
(c)UNIT_DECREMENT (d)UNIT_INCREMENT
25.Which of these methods can be used to obtain the coordinates of a mouse?
(a)getPoint() (b)getCoordinates() (c)getMouseXY()
(d)getMouseCoordinates()