-
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)
-
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.
-
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.
-
-
All Applets are subclasses of Applet.
A) TrueB) False
-
Which of the following are direct or indirect subclasses of Container? (Select Multiple)
A) FrameB) TextAreaC) MenuBarD) FileDialogE) Applet
-
-
All Applets must import java.applet and java.awt.
A) TrueB) False
-
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
-
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 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);
-
-
Heavyweight componants are not handled properly when they are placed inside the JScrollpane�s viewport because(Select Multiple)
A) JScrollPane is a lightweight component.B) Viewport of JScrollPane which clips its scrollable child, is lightweightC) None of the aboveD) Either of the above.
-
Fill in the blanks :- The highest-level event class of the event-delegation model is _____
A) java.util.eventObject
-
Fill in the blank :- the default look and feel of a swing component is _____________
A) Java Look and Feel
-
-
A text field has a variable-width font. It is constructed by calling new TextField("iiiii"). What happens if you change the contents of the text field to "wwwww"? (Bear in mind that is one of the narrowest characters, and w is one of the widest.)
A) The text field becomes wider.B) The text field becomes narrower.C) The text field stays the same width; to see the entire contents you will have to scroll by using the � and � keys.D) The text field stays the same width; to see the entire contents you will have to scroll by using the text field�s horizontal scroll bar.
-
What are the immediate super classes of the following classes? (Select Multiple)
A) Container - ComponentB) MenuComponent - ObjectC) Dialog - WindowD) Applet - Panel
-
How to assign different reference into an another reference.
suppose i have 4 JFrames in my project and i want to use single JDialog for all the JFrames, in such situation i have to pass the current JFrame class ie "this" keyword , the problem to receive different reference in the same class in different JFrames.
I have already tried by using Object class ,but it was not acceptedmy be through abstract classes or interfaces
Java Swing Interview Qustions
Ans