-
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
-
Which of the following options are correct regarding the organization of layouts (Select Multiple)
A) FlowLayout : The elements of a FlowLayout are organized in a top to bottom, left to right fashion.B) BorderLayout : The elements of a BorderLayout are organized at the borders (North, South, East and West) and the center of a container.C) CardLayout : The elements of a CardLayout are stacked, one on top of the other, like a deck of cards.D) GridBagLayout : The elements of a GridLayout are of equal...
-
Fill in the blanks :- The meaning of ‘x’ in javax.swing is _______________
A) Extension of java
-
Which of the following are methods of the Graphics class? (Select Multiple)
A) drawRect( )B) drawImage( )C) drawPoint( )D) drawString( )
-
What does the following code draw?g.setColor(Color.black);g.drawLine(10, 10, 10, 50);g.setColor(Color.RED);g.drawRect(100, 100, 150, 150);
A) A red vertical line that is 40 pixels long and a red square with sides of 150 pixelsB) A black vertical line that is 40 pixels long and a red square with sides of 150 pixelsC) A black vertical line that is 50 pixels long and a red square with sides of 150 pixelsD) A red vertical line that is 50 pixels long and a red square with sides of 150 pixelsE) A black vertical line that is 40 pixels long and...
-
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:
A) Only the "third" button is displayed.B) A runtime exception is generated (no layout manager specified).C) Only the "first" button is displayed.D) Only the "second" button is displayed.
-
The three most common z-order related problems have to do with Swings following componants. (Select Multiple)
A) JScrollPane.B) JInternalFrameC) JInternalFrame popup componants.D) JPanel.
-
The types of popups in swing are 1. Lightweight Popup2. Heavyweight popup3. Medium weight popup
A) 1, 2B) 2, 3C) 1, 3D) 1, 2, 3
-
Which containers use border layout as their default layout ? (Select Multiple)
A) PanelB) DialogC) FrameD) Window
Java Swing Interview Qustions
Ans