-
-
Which of the following methods are defined on the Graphics class:
A) drawLine(int, int, int, int)B) drawImage(Image, int, int, ImageObserver)C) drawString(String, int, int)D) add(Component);E) setVisible(boolean);F) setLayout(Object);
-
Which of the following statement(s) are true?
A) The default layout manager for an Applet is FlowLayoutB) The default layout manager for an application is FlowLayoutC) A layout manager must be assigned to an Applet before the setSize method is calledD) The FlowLayout manager attempts to honor the preferred size of any components
-
Which of the following option(s) doesn’t correctly describe the Applet’s Life Cycle methods?
A) init( ) method - Can be called when an applet is first loaded.B) start( ) method - Can be called each time an applet is started.C) paint( ) method - Can be called when the applet is minimized or refreshed.D) destroy( ) method - Can be called when the browser moves off the applet’s page.Explanation: it is the explanation for stop(), while destroy( ) method - Can be called when the browser is finished...
-
You have created a simple Frame and overridden the paint method as follows public void paint(Graphics g){ g.drawString("Dolly",50,10);}What will be the result when you attempt to compile and run the program?
A) The string "Dolly" will be displayed at the centre of the frameB) An error at compilation complaining at the signature of the paint methodC) The lower part of the word Dolly will be seen at the top of the form, with the top hidden.D) The string "Dolly" will be shown at the bottom of the form
-
All Applets must import java.applet and java.awt.
A) TrueB) False
-
-
Which of the following are direct or indirect subclasses of Container? (Select Multiple)
A) FrameB) TextAreaC) MenuBarD) FileDialogE) Applet
-
All Applets are subclasses of Applet.
A) TrueB) False
-
-
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?
A) The scroll bar’s height would be its preferred height, which is not likely to be enough.B) The scroll bar’s width would be the entire width of the frame, which would be much wider than necessary.C) Both a and b.D) Neither a nor b. There is no problem with the layout as described.
-
What class is the top of the AWT event hierarchy?
A) java.awt.AWTEventB) java.awt.EventC) java.util.eventObjectD) javax.swing.ObjectExplanation: The java.awt.AWTEvent class is the highest-level class in the AWT event class hierarchy.
-
What are the features coming with JFC?. (Select Multiple)
A) Pluggable Look-and-FeelB) Accessibility APIC) Java 2D/API(JDK 1.2).D) Drag and Drop Support(JDK 1.2)
-
-
Which of the following are true?
A) The event-inheritance model has replaced the event-delegation model.B) The event-inheritance model is more efficient than the event-delegation model.C) The event-delegation model uses event listeners to define the methods of event-handling classes.D) The event-delegation model uses the handleEvent( ) method to support event handling.
-
-
Which of the following (is)are true?
A) A Dialog can have a MenuBar.B) MenuItem extends Menu.C) A MenuItem can be added to a Menu.D) A Menu can be added to a Menu.
-
Which Font attributes are available through the FontMetrics class? (Select Multiple)
A) ascentB) leadingC) caseD) height
-
-
What are invisible componants in swings ? (Select Multiple)
A) Componants which take space in the GUI on the client interface.B) Componants which cannot perform painting operation.C) Componants which can perform painting operation.D) The componants that are visible but no componants can be added in it.
Java Swing Interview Qustions
Ans