FE PRJ311 - Java Desk

Ace your homework & exams now with Quizwiz!

What font will be used to display the Button label?

10-point TimesRoman

Which of the following are passed as an argument to the paint() method?

A Graphics object

Which of the following (is)are true?

A MenuItem can be added to a Menu.

Which of the following is correct about RowSet?

A RowSet objects are JavaBeans components.

What is the difference between a Scollbar and a Scrollpane?

A Scrollbar is a Component, but not a Container.

What is the difference between a Scollbar and a Scrollpane?

A Scrollbar is a Component,but not a Container.

Which of the following are true?

A component..an event listener,A component..own events.

Which of the following is correct about Connected RowSet?

A connected RowSet..nature,A connected RowSet doesn't..is terminated.

Which of the following may contain a menu bar?

A frame

What is the preferred way to handle an objectfs events in Java 2?

Add one or more event listeners to handle the events.

Which of the following can cause 'No suitable driver' error?

All of the above.

Which of the following is correct about transactions in JDBC?

All of the above.

Why will you set auto commit mode to false?

All of the above.

An application has a frame that uses a Border layout manager. Why is it probably not a good idea to put a vertical scroll bar at North in the frame?

Both a and b.

How does JDBC handle the data types of Java and database?

Both of the above.

Which of the following is correct about SQL Warning?

Both of the above.

Which of the following is correct about savepoint?

Both of the above.

Which of the following are direct or indirect subclasses of Component?

Button,Label,Frame!Frame

Which of the following are direct or indirect subclasses of Component?

Button,Label,Frame,FileDialog,Applet

Which of the following classes have a paint( ) method?

Canvas,Frame

Which Component subclass is used for drawing and painting?

Canvas.

Which object is needed to group Checkboxes to make them exclusive?

CheckboxGroup.

What is the difference between a Choice and a List?

Choice is displayed in a compact form that requires..choices

What background color will be used with the Panel?

Color.Yellow

What are the immediate super classes of the following classes?

Container-Component,MenuComponent-Object,Dialog-Window

Which containers use border layout as their default layout ?

Dialog,Frame,Window

How do you indicate where a component will be positioned using Flowlayout?

Do nothing, the FlowLayout will position the component

What are the types of Checkboxes and what is the difference between them?

Exclusive and Non-exclusive.

If a frame uses its default layout manager and does not contain any panels, then all the components within the frame are the same width and height.

False

The CheckboxGroup class is a subclass of the Component class.

False

The Choice component allows multiple selection.

False

The List component does not generate any events.

False

When using the GridBagLayout manager, each new component requires a new instance of the GridBagConstraints class. Is this statement true or false?

False

When you say Class.forName() loads the driver class, does it mean it imports the driver class using import statement?

False

With a Border layout manager, the component at Center gets all the space that is left over, after the components at North and South have been considered.

False

Which of the following options are correct regarding the organization of layouts

FlowLayout,BorderLayout,CardLayout

Which of the following AWT components can have a menu, either as a menu bar or pop-up menu, attached to it?

Frame,Window,Applet,Panel

Which layout should you use to organize the components of a container in a tabular form?

GridLayout

Which of the following layout managers honours the preferred size of a component:

GridLayout

What is meant by Controls and what are different types of controls?

Labels,Push buttons,Check boxes,Choice lists,Lists,Scroll bars,Text components

Which of the following components allow multiple selections?

Non-exclusive Checkboxes.,List.

All the componenet classes and container classes are derived from _ class.

Object.

What is the result of executing the following Java class: import java.awt.*; public class FrameTest extends Frame { public FrameTest() { add (new Button("First")); add (new Button("Second")); add (new Button("Third")); pack(); setVisible(true);} public static void main(String args []) { new FrameTest();}} Select from the following options:

Only the "third" button is displayed.

Which of the following required to be closed to close database operations?

ResultSet,Statement,Connection

Which of the following means that the ResultSet can only be read?

ResultSet.CONCUR_READ_ONLY

Which of the following means that the ResultSet can be both read and updated?

ResultSet.UPDATABLE

What is the difference between scrollbar and scrollpane

Scrollbar is..a container,Scrollpane handles..own scrolling.

Can a class be itfs own event handler?

Sure.

What are the SubClass of Textcomponent Class?

TextField and TextArea

Which components are used to get text input from the user.

TextField and TextArea.

Which of the following are true?

The AWT automatically..maximized,The AWT .. data is changed.

Which of the following are passed as an argument to the paint( ) method?

The Graphic object

Which of the following are true?

The MouseListener...,The ActionListener..

Which containers use a FlowLayout as their default layout?

The Panel and the Applet classes

Suppose a Panel is added to a Frame and a Button is added to the Panel. If the Framefs font is set to 12-point TimesRoman, the Panelfs font is set to 10-point TimesRoman, and the Buttonfs font is not set, what font will be used to display the Buttonfs label?|10-point TimesRoman A Framefs background color is set to Color. Yellow, and a Buttonfs background color is to Color.Blue. Suppose the Button is added to a Panel, which is added to the Frame. What background color will be used with the Panel?|Colr.Yellow Which containers use a BorderLayout as their default layout?

The Window, Frame and Dialog classes

Which of the following are true?

The event-delegation..methods of event-handling classes.

What is the preferred size of a component?

The preferred size of a component size

What happens if you change the contents of the text field to "wwwww"?

The text field stays the same ... using the ß and Ekeys.

Which are true about the Container class?

The validate( )..,The add( ) ..,The getComponent( )..

Which are true about the Container class?

The validate()..,The add(),The getComponent()

When two or more objects are added as listeners for the same event, which listener is first invoked to handle the event?

There is no way to determine which listener will be invoked first.

What is the default layouts for a applet, a frame and a panel?

True

Which constructor creates a TextArea with 10 rows and 20 columns?

Usage is TextArea(rows, columns)

How do you change the current layout manager for a container?

Use the setLayout method

What are the subclasses of the Container class?

Window,Panel,ScrollPane

Which method of the container class can be used to add components to a Panel.

add() method.

Which Font attributes are available through the FontMetrics class?

ascent,leading,height

Which of the following methods are defined on the Graphics class:

drawLine,drawImage,drawString

Which of the following are methods of the Graphics class?

drawRect(),drawImage(),drawString()

What methods are used to get and set the text label displayed by a Button object?

getLabel() and setLabel()

Which Component method is used to access a component's immediate Container?

getParent()

Which method returns the preferred size of a component?

getPreferredSize()

What Checkbox method allows you to tell if a Checkbox is checked?

getState()

Which of the following is used generally used for altering the databases?

int executeUpdate()

The methods wait() and notify() are defined in?

java.lang.Object

Out of byte[] or a java.sql.Blob, which has best performance when used to manipulate data from database?

java.sql.Blob

Out of String or a java.sql.Clob, which has best performance when used to manipulate data from database?

java.sql.Clob

What class is the top of the AWT event hierarchy?

java.util.eventObject

Which of the following creates a List with 5 visible items and multiple selection enabled?

new List(5, true)

You want to construct a text area that is 80 character-widths wide and 10 character-heights tall. What code do you use?

new TextArea(10, 80)

Which of the following methods are invoked by the AWT to support paint and repaint operations?

paint()

Which TextComponent method is used to set a TextComponent to the read-only state ?

setEditable()

Which of the following is correct about setFetchSize(int)?

setFetchSize(int) defines the number of rows that will be read from the database when the ResultSet needs more rows.

Which method is method to set the layout of a container?

setLayout()

The layout of a container can be altered by using which of the following methods

setLayout(aLayoutManager)

Which of the following is correct about setMaxRows(int)?

setMaxRows(int) method of the ResultSet specifies how many rows a ResultSet can contain at a time.

Which method is used to set the text of a Label object?

setText()

Which method will cause a Frame to be displayed?

show(),setVisible()

Suppose that you want to have an object eh handle the TextEvent of a TextArea object t.How should you add eh as the event handler for t?

t.addTextListener(eh);

What does the following code draw?

g.drawLine(10, 10, 10, 50);

Which method of the component class is used to set the position and the size of a component?

setBounds()

When we invoke repaint() for JAVA.awt.Component object, the AWT invokes the method

update()

Which Container method is used to cause a container to be laid out and redisplayed?

validate()


Related study sets

NEMCC Intro to Business Ms Bowlin FINIAL

View Set

Chapter 1: The Life-Span Perspective

View Set

Topic A: Configure and Use Linux

View Set

Chapter 21: The Immune System: Innate and Adaptive Body Defenses

View Set

Essentials of Investments: Chapter 10

View Set

2.5 Roadways and Their Unique Risks

View Set

Ch4 Analysing the marketing environment.

View Set