Java AWT, Swing & Fundamentals
Questions covering Java AWT components, Swing UI elements, event handling, graphics, and core Java language concepts.
Questions
How many constructors are there for Layout manager FlowLayout?
- 5
- 4
- 3
- 2
- 1
Which of the following methods is/are valid in Java for event handling?
- mouseEnetered()
- keyReleased()
- mouseDragged()
- Both 1 & 2
- All of these
Which of the following methods is not defined in the Graphics class in java?
- fillRect()
- fillCircle()
- fillOval()
- fillArc()
- None of these
How many constructors are present of BorderLayout in java?
- 5
- 4
- 3
- 2
- 1
Which of the following statements about the given statement is correct?
Color c1 = new Color(284,60,189);
- A new color will be created.
- runtime Exception
- Parameters are not enough
- Compile time error : cannot find method color
- Compile time error : Color is Abstract cannot xreate an object.
How many parameters are passed to the constructor of the Font class in java?
- 4
- 3
- 2
- 1
- None of these
How many primitive data types are available in java?
- 9
- 6
- 8
- 7
- 5
Which of the following source objects does not generate the ActionEvent?
- JRadioButton
- JCheckBox
- JComboBox
- JList
- JTextField
Which of following layout managers is/are present in java awt?
- Gridlayout
- Flowlayout
- Cardlayout
- Both 1 and 2
- 1, 2 and 3
Which of the following methods cannot be invoked from the instance of Frame class in AWT?
- setLocation(int ,int)
- setVisible(Boolean)
- setSize(int , int)
- setDefaultCloseOperation(int)
- Pack()
Which of the following event types is/are invalid in java?
- FocusEvent
- ComponentEvent
- AdjustmentEvent
- Both 2 and 3
- None of these
Which of the following methods is not necessary to define for a class if it implements the windowListener Interface?
- windowMoved()
- windowClosing()
- windowIconified()
- windowActivated()
- windowDeiconified()
Which of the following methods is/are used by a web browser to control the applet?
- Wait()
- Destroy()
- Dead()
- Both 1 and 3
- Both 1 and 2
Which of the following is the subclasses of RuntimeException?
- IllegalArgumentException
- NullPointerException
- IOException
- IndexOutOfBoundException
- ArithmeticException
Which of the following is not the method of the scanner class object in java?
- Next()
- nextLine()
- nextInt()
- nextChar()
- nextLong()