Java Swing and AWT Layout Managers

Java Swing

15 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

How many maximum arguments can be passed to the FlowLayout constructor?

  1. 5
  2. 4
  3. 3
  4. 2
  5. 1
Question 2 Multiple Choice (Single Answer)

How many maximum arguments can we pass to the GridLayout constructor?

  1. 6
  2. 5
  3. 4
  4. 3
  5. 2
Question 3 Multiple Choice (Single Answer)

How many layout managers are present in Java?

  1. 10
  2. 9
  3. 8
  4. 7
  5. 6
Question 4 Multiple Choice (Single Answer)

What is the third argument passed to a constructor of Font class?

  1. Int Size
  2. String name
  3. Int Style
  4. Int Alignment
  5. Int Colour
Question 5 Multiple Choice (Single Answer)

Which of the following helper classes is/are not associated with Java AWT?

  1. LayoutManager
  2. Colour
  3. Font
  4. Dimensions
  5. Graphics
Question 6 Multiple Choice (Single Answer)

What is the third argument passed to the constructor of GridLayout?

  1. Int Rows
  2. Int Columns
  3. Int HorizontalGap
  4. Int VerticalGap
  5. Int Alignmnent
Question 7 Multiple Choice (Single Answer)

Which of the following is the third argument passed to the constructor of FlowLayout?

  1. Int HorizontalGap
  2. Int VerticalGap
  3. Int Alignment
  4. Int Rows
  5. Int Columns
Question 8 Multiple Choice (Single Answer)

How many maximum arguments can be passed to the BorderLayout constructor?

  1. 5
  2. 4
  3. 3
  4. 2
  5. 1
Question 9 Multiple Choice (Single Answer)

Which of the following is a helper class in Java AWT?

  1. Window
  2. Applet
  3. Panel
  4. Dimension
  5. Dialog
Question 10 Multiple Choice (Single Answer)

How many container classes are there in Java AWT?

  1. 6
  2. 5
  3. 4
  4. 3
  5. 2
Question 11 Multiple Choice (Single Answer)

What is the third argument passed to the constructor of BorderLayout?

  1. Int Alignment
  2. Int HorizontalGap
  3. Int VerticalGap
  4. Int Rows
  5. None of these
Question 12 Multiple Choice (Single Answer)

What is the second argument passed to the constructor of GridLayout?

  1. Int Rows
  2. Int Columns
  3. Int HorizontalGap
  4. Int VerticalGap
  5. Int Alignment
Question 13 Multiple Choice (Single Answer)

How many constructors are there in CardLayout?

  1. 5
  2. 4
  3. 3
  4. 2
  5. 1
Question 14 Multiple Choice (Single Answer)

JPanel p1 = new JPanel()

What is the default Layout Manager of panel p1 that we have created?

  1. BorderLayout
  2. CardLayout
  3. FlowLayout
  4. GridLayout
  5. BoxLayout
Question 15 Multiple Choice (Single Answer)

How many arguments are passed to the constructor of Font class?

  1. 5
  2. 4
  3. 3
  4. 2
  5. 1