Home / CSE MCQs / AWT ::

CSE MCQs :: AWT

  1. Which is the container that doesn't contain title bar and MenuBars but it can have other components like button, textfield etc?
  2. A.
    Window
    B.
    Frame
    C.
    Panel
    D.
    Container

  3. The Swing Component classes that are used in Encapsulates a mutually exclusive set of buttons?
  4. A.
    AbstractButton
    B.
    ButtonGroup
    C.
    JButton
    D.
    ImageIcon

  5. Which package provides many event classes and Listener interfaces for event handling?
  6. A.
    java.awt
    B.
    java.awt.Graphics
    C.
    java.awt.event
    D.
    None of the above

  7. In Graphics class which method is used to draws a rectangle with the specified width and height?
  8. A.
    public void drawRect(int x, int y, int width, int height)
    B.
    public abstract void fillRect(int x, int y, int width, int height)
    C.
    public abstract void drawLine(int x1, int y1, int x2, int y2)
    D.
    public abstract void drawOval(int x, int y, int width, int height)

  9. Name the class used to represent a GUI application window, which is optionally resizable and can have a title bar, an icon, and menus.
  10. A.
    Window
    B.
    Panel
    C.
    Dialog
    D.
    Frame

  11. Which is the container that doesn't contain title bar and MenuBars but it can have other components like button, textfield etc?
  12. A.
    Window
    B.
    Frame
    C.
    Panel
    D.
    Container

  13. The Swing Component classes that are used in Encapsulates a mutually exclusive set of buttons?
  14. A.
    AbstractButton
    B.
    ButtonGroup
    C.
    JButton
    D.
    ImageIcon

  15. Which package provides many event classes and Listener interfaces for event handling?
  16. A.
    java.awt
    B.
    java.awt.Graphics
    C.
    java.awt.event
    D.
    None of the above

  17. In Graphics class which method is used to draws a rectangle with the specified width and height?
  18. A.
    public void drawRect(int x, int y, int width, int height)
    B.
    public abstract void fillRect(int x, int y, int width, int height)
    C.
    public abstract void drawLine(int x1, int y1, int x2, int y2)
    D.
    public abstract void drawOval(int x, int y, int width, int height)

  19. Name the class used to represent a GUI application window, which is optionally resizable and can have a title bar, an icon, and menus.
  20. A.
    Window
    B.
    Panel
    C.
    Dialog
    D.
    Frame