Java Swing GUI Components

Questions about Java Swing GUI classes including JLabel, JComponent, JProgressBar, JScrollPane, JTabbedPane, JFormattedTextField, and AbstractButton methods.

13 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

Which of the methods are not present in the JLabel class in java?

  1. getDisplayedMnemonic()
  2. getDisabledIcon()
  3. getIconTextGap()
  4. All of the above
  5. Both 1 and 2
Question 2 Multiple Choice (Single Answer)

Which of the following methods are present in AbstaractButton Class in java?

  1. setVerticalAlignment(int alignment)
  2. setMultiClickThreshhold(long threshhold)
  3. setMargin(Insets m)
  4. Both 1 and 3
  5. All of the above
Question 3 Multiple Choice (Single Answer)

Which of the following methods are invalid in java GUI?

  1. createLoweredBevelBorder()
  2. createRaisedBevelBorder()
  3. createBevelBorder(int, Color, Color)
  4. createMatteBorder(int, int, int, int, Color)
  5. createFilledBorder()
Question 4 Multiple Choice (Single Answer)

Which of the following methods are not present in JProgressBar class in java?

  1. getPercentComplete()
  2. setBorderPainted(boolean)
  3. setPaintedBorder(boolean)
  4. isStringPainted(boolean)
  5. setMinimum(int)
Question 5 Multiple Choice (Single Answer)

Which of the following methods are present in JComponent class in java?

  1. getComponentCount()
  2. getTopLevelAncestor()
  3. getPane()
  4. Both 1 and 2
  5. All of the above
Question 6 Multiple Choice (Single Answer)

Which of the following methods are present in the JScrollPane class in java?

  1. isWheelScrollingEnabled()
  2. isScrollingWheelEnabled()
  3. getScrollsOnExpand()
  4. Both 1 and 2
  5. Both 1 and 3
Question 7 Multiple Choice (Single Answer)

Which of the following methods is/are not present in JComponent class in java?

  1. isShowing()
  2. getLocationOnScreen()
  3. getInsets()
  4. isOpaque()
  5. isCircle()
Question 8 Multiple Choice (Single Answer)

Which of the following methods are present in the JTabbedPane class?

  1. indexOfTabComponent(Component)
  2. getTabComponentAt(int)
  3. setTabComponentAt(int, Component)
  4. Both 2 and 3
  5. All of these
Question 9 Multiple Choice (Single Answer)

Which of the following methods are present in JFormattedTextField Class?

  1. getAllowsInvalid()
  2. getOverwriteMode()
  3. setCommitsOnValidEdit(boolean)
  4. Both 1 and 2
  5. All of the above
Question 10 Multiple Choice (Single Answer)

Which of the following methods are not present in JComponent class in java?

  1. getComponentGraphics(Graphics g)
  2. isLightweightComponent(Component c)
  3. isPaintingTile()
  4. isPaintingForPrint()
  5. isPrinting()
Question 11 Multiple Choice (Single Answer)

How many constructors of WeakHashMap are there in Java collections Framework?

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

Which of the following methods are present in AbstractButton class?

  1. setTextVerticalPosition(int textPosition)
  2. setSelectedRolloverIcon(Icon rolloverSelectedIcon)
  3. setTextHorizontalPosition(int textPosition)
  4. setDisplayedMnemonicIndex(int index)
  5. setTextGap(int iconTextGap)
Question 13 Multiple Choice (Single Answer)

Which of the following methods is not present in AbstractButton class in java?

  1. setRolloverEnabled(boolean)
  2. setPressedIcon(Icon)
  3. setDisabledIcon(Icon)
  4. setSelectedIcon(Icon)
  5. setSelectedRolloverIcon(Icon)