AJP Unit-1
70 Questions
15 Views
4.6 Stars

AJP Unit-1

Test your knowledge of Java GUI controls, containers, and event handling with this quiz. Questions cover topics such as labeling controls, types of containers, MVC architecture, interface and event handling, and processing methods.

Created by
@GlamorousHeliodor

Questions and Answers

A label is a simple control which is used to display_____________ on the window:

Text(non-editable)

Which type of container do not have any type of menubar?

Panel

MVC means Model View ___________

Controller

The interface is used to handle the menu events

<p>ActionListener</p> Signup and view all the answers

The ActionListener interface is not used for handling action events?

<p>False</p> Signup and view all the answers

Which class is used for this processing method processActionEvent()?

<p>Button,List,MenuItem</p> Signup and view all the answers

Which event is generated when the position of scrollbar is changed?

<p>AdjustmentEvent</p> Signup and view all the answers

A Frame's _______________ designates the area of the frame excluding the title,menu bar and the border.

<p>ContentPane</p> Signup and view all the answers

At the top of the AWT hierarchy is the__________________ class.

<p>Component</p> Signup and view all the answers

By default the Frame has a _______________________________

<p>Titlebar,borders,resizing corners</p> Signup and view all the answers

By which method You can set or change the text in a Label?

<p>setText()</p> Signup and view all the answers

BorderLayout b = new BorderLayout(3,4); The above statement is incorrect

<p>True</p> Signup and view all the answers

By default flowlayout uses __________justification.

<p>Center</p> Signup and view all the answers

Border Layout is divided into_________regions.

<p>Five</p> Signup and view all the answers

Combobox is a combination of ________________________

<p>TextField and Dropdown List</p> Signup and view all the answers

Default layout manager for Window is

<p>Borderlayout</p> Signup and view all the answers

How To Apply Image To Button ?

<p>using ImageIcon</p> Signup and view all the answers

In AWT Checkbox class is used to create __________

<p>Checkbox and Radio buttons</p> Signup and view all the answers

How would you set the color of a graphics context called g to cyan?

<p>g.setColor(Color.cyan);</p> Signup and view all the answers

AWT is heavy weight component

<p>True</p> Signup and view all the answers

setMenuBar() method of which class?

<p>MenuBar</p> Signup and view all the answers

In given constructor what 3rd parameter indictaes Scrollbar s=new Scrollbar(0,10,20,0,1000)

<p>Size of thumb</p> Signup and view all the answers

In order to obtain currunt value of scrollbar at run time which method you will use

<p>getValue()</p> Signup and view all the answers

What is point?

<p>It Encapsulates a Cartesian coordinate pair, stored in x and y</p> Signup and view all the answers

what will be the output

<p>Error</p> Signup and view all the answers

Which of the following are the methods of checkbox

<p>Both a and b</p> Signup and view all the answers

What is API

<p>Application Programming Interface</p> Signup and view all the answers

_____________ method returns currently selected item in choice.

<p>getSelectedItem()</p> Signup and view all the answers

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

<p>drawString()</p> Signup and view all the answers

What are the types of DialogBox?

<p>Modal and Modeless DialogBox</p> Signup and view all the answers

The following way is used to create a frame is by creating the object of Frame class?

<p>association</p> Signup and view all the answers

Panel class is a concrete sub-class of container.

<p>True</p> Signup and view all the answers

When there is a switching condition like ON or OFF, which control is used of following?

<p>ToggleButton</p> Signup and view all the answers

All Component on Container can be removed by calling following method

<p>removeAll()</p> Signup and view all the answers

Canvas is a ________________

<p>Window</p> Signup and view all the answers

Which is the container that contain title bar and can have MenuBars.It can have other components likenbutton,textfield etc.?

<p>Frame</p> Signup and view all the answers

Which class provides many methods for graphics programming?

<p>java.awt.Graphics</p> Signup and view all the answers

The getContentPane() method is of which clasS?

<p>None of these</p> Signup and view all the answers

Frame is a standard window, which is _______________ of window class from AWT hierarchy?

<p>Derived class / Subclass</p> Signup and view all the answers

Which of these classes can be added to any Container class, using the add method defined in Container class?

<p>Button</p> Signup and view all the answers

The method _________________ places a Menu m into the MenuBar mb.

<p>mb.add(m)</p> Signup and view all the answers

________________ is a swing class that allows to enter a singleline of text.

<p>JTextField</p> Signup and view all the answers

The correct hierarchy for Panel is___________________

<p>Component-Container-Panel</p> Signup and view all the answers

Controls not supported by awt are

<p>TabbedPane,Table</p> Signup and view all the answers

Executable applet is nothing but _________ file of applet

<p>.class</p> Signup and view all the answers

In FlowLayout manager the default space between each component is

<p>5 Pixel</p> Signup and view all the answers

Scrollbar( ) creates a ______________ scroll bar by default.

<p>Vertical</p> Signup and view all the answers

Text field usually called as

<p>edit Control</p> Signup and view all the answers

The method setLabel can be used with what type of Object ?

<p>TextField</p> Signup and view all the answers

To retrieve the current state of a check box,call


<p>getState()</p> Signup and view all the answers

Which Among the below is not an AWT class.

<p>RadioButton</p> Signup and view all the answers

Which of the following are the methods of choice

<p>All of these</p> Signup and view all the answers

Which of the following is the correct method of scrollbar

<p>int getOrientation()</p> Signup and view all the answers

Which class can be used to represent a checkbox with a textual label that can appear in a menu. Select the one correct answer.

<p>CheckboxMenuItem</p> Signup and view all the answers

What will be the output of line 5

<p>3</p> Signup and view all the answers

Which components are reuired to get following output

<p>List and Button</p> Signup and view all the answers

Select one option

<p>Label,TextField</p> Signup and view all the answers

Which is the correct constructor of GridLayout

<p>GridLayout(int numrows, int numcols)</p> Signup and view all the answers

init() method exectues only once.

<p>True</p> Signup and view all the answers

Which of the following controls does not support interaction with user?

<p>Label</p> Signup and view all the answers

Select any one

<p>Component class</p> Signup and view all the answers

Select any one

<p>10 point Times New Roman</p> Signup and view all the answers

Which components are used in the following output

<p>Button, TextField, Checkbox, Choice, TextArea</p> Signup and view all the answers

Choose the correct sequence for the following output

<p>TextField, TextArea, Checkbox1, Checkbox2</p> Signup and view all the answers

Components in the frame is added at appropriate place using

<p>setBounds(int,int,int,int)</p> Signup and view all the answers

Multiple layouts in the single conainer can be created with the help of


<p>Panel</p> Signup and view all the answers

Say that a Frame contains three Panels. Could each Panel have a different layout manager?

<p>Yes---each one can use setLayout() with any layout manager</p> Signup and view all the answers

Which statement with respect to inner class is true.

<p>All Statements A,B,C are true</p> Signup and view all the answers

The set Background() method is part of which of the following class java.awt package

<p>Component</p> Signup and view all the answers

How many types of controls does AWT supports these controls are Subclasses of component?

<p>7</p> Signup and view all the answers

More Quizzes Like This

Use Quizgecko on...
Browser
Browser