-
Using a FlowLayout Manager, which of the following is the correct way to add elements to a container. (Select Multiple)
A) add(component);B) set(component);C) add(x,y, component);D) add(“Center”,component);
-
State true or false :-Images can be displayed in swings
A) TrueB) False
-
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)
-
Fill in the blanks :- The meaning of ‘x’ in javax.swing is _______________
A) Extension of java
-
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.
-
-
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
-
All Applets are subclasses of Applet.
A) TrueB) False
-
Which Font attributes are available through the FontMetrics class? (Select Multiple)
A) ascentB) leadingC) caseD) height
-
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 are direct or indirect subclasses of Container? (Select Multiple)
A) FrameB) TextAreaC) MenuBarD) FileDialogE) Applet
-
-
-
Lightweight components differ from heavy weight componants not because of one of the following reasons
A) A heavyweight component have transparent pixels which lightweight have opaque.B) A lightweight can appear to be non-rectangular while heavyweight are always rectangular.C) Mouse events on light weight componants fall through its parents while in the heavyweight it doesn’t.D) On overlapping of the lightweight component over the heavy weight component the heavy weight component is always on top.Explanation:...
-
What are the restrictions imposed by the security manager on applets. (Select Multiple)
A) Cannot start any program on the host that is executing it.B) Cannot read some system properties.C) Cannot load libraries or define native methods.D) Cannot read or write files on the host that is executing it.
-
-
Fill in the blanks :- The highest-level event class of the event-delegation model is _____
A) java.util.eventObject
-
Which of the following are methods of the Graphics class? (Select Multiple)
A) drawRect( )B) drawImage( )C) drawPoint( )D) drawString( )
-
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 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);
Java Swing Interview Qustions
Ans