Sample Questions Best site for GRE, LSAT, SAT, GMAT, TOEFL, CCNA, CCSA and interview sample questions  

Technical Sample Questions : C |  C++ |  Oracle |  Java | Unix |  Operating Systems |  Data Structure

Java Sample Questions ›› Java AWT Sample Questions

Technical Java Sample Questions : Java AWT Sample Questions

  1. What is meant by Controls and what are different types of controls?

    Answer: Controls are componenets that allow a user to interact with your application. The AWT supports the following types of controls:

    • Labels
    • Push buttons
    • Check boxes
    • Choice lists
    • Lists
    • Scroll bars
    • Text components

    These controls are subclasses of Component.

  2. Which method of the component class is used to set the position and the size of a component?

    Answer: setBounds(). The following code snippet explains this:

    txtName.setBounds(x,y,width,height);

    places upper left corner of the text field txtName at point (x,y) with the width and height of the text field set as width and height.

  3. Which TextComponent method is used to set a TextComponent to the read-only state?

    Answer: setEditable()

  4. How can the Checkbox class be used to create a radio button?

    Answer: By associating Checkbox objects with a CheckboxGroup.

  5. What methods are used to get and set the text label displayed by a Button object?

    Answer: To get the text label:

    getLabel( )

    To set the text label:

    setLabel( )

  6. What is the difference between a Choice and a List?

    Answer: Choice: A Choice is displayed in a compact form that requires you to pull it down to see the list of available choices. Only one item may be selected from a Choice.

    List: A List may be displayed in such a way that several List items are visible. A List supports the selection of one or more List items.

  7. What is the difference between a Scollbar and a Scrollpane?

    Answer: A Scrollbar is a Component, but not a Container. A Scrollpane is a Container and handles its own events and performs its own scrolling.

  8. What are the subclasses of the Container class?

    Answer: The Container class has three major subclasses. They are:

    • Window
    • Panel
    • ScrollPane

  9. Which object is needed to group Checkboxes to make them exclusive?

    Answer: CheckboxGroup.

  10. What are the types of Checkboxes and what is the difference between them?

    Answer: Java supports two types of Checkboxes:

    • Exclusive
    • Non-exclusive

    In case of exclusive Checkboxes, only one among a group of items can be selected at a time. I f an item from the group is selected, the checkbox currently checked is deselected and the new selection is highlighted. The exclusive Checkboxes are also called as Radio buttons. The non-exclusive checkboxes are not grouped together and each one can be selected independent of the other.

Next »

Java AWT Sample Question Number : 1-10| 11-16
Sample Test Questions
GRE Sample Questions
CAT Sample Questions
GMAT Sample Questions
TOEFL Sample Questions
ACT Sample Questions
SAT Sample Questions
LSAT Sample Questions
PSAT Sample Questions
MCAT Sample Questions
PMP Sample Questions
GED Sample Questions
ECDL Sample Questions
DMV Sample Questions
CCNA Sample Questions
MCSE Sample Questions
Network+ Sample Questions
A+ Sample Questions
Technical Sample Questions
WASL Sample Questions
CISA Sample Questions

Other Sample Questions
Sample Interview Questions
Sample Teacher Interview Questions
Sample Citizenship Questions
Accuplacer Sample Questions
Science Bowl sample Questions
Driving Test Sample Questions
Sample Survey Questions Sample Essay Questions
Sample Behavioral Interview Questions

Copyright © 2004-2013, Best BSQ. All Rights Reserved.