Java Swing GUI Components
Questions about Java Swing GUI classes including JLabel, JComponent, JProgressBar, JScrollPane, JTabbedPane, JFormattedTextField, and AbstractButton methods.
Questions
Which of the methods are not present in the JLabel class in java?
- getDisplayedMnemonic()
- getDisabledIcon()
- getIconTextGap()
- All of the above
- Both 1 and 2
Which of the following methods are present in AbstaractButton Class in java?
- setVerticalAlignment(int alignment)
- setMultiClickThreshhold(long threshhold)
- setMargin(Insets m)
- Both 1 and 3
- All of the above
Which of the following methods are invalid in java GUI?
- createLoweredBevelBorder()
- createRaisedBevelBorder()
- createBevelBorder(int, Color, Color)
- createMatteBorder(int, int, int, int, Color)
- createFilledBorder()
Which of the following methods are not present in JProgressBar class in java?
- getPercentComplete()
- setBorderPainted(boolean)
- setPaintedBorder(boolean)
- isStringPainted(boolean)
- setMinimum(int)
Which of the following methods are present in JComponent class in java?
- getComponentCount()
- getTopLevelAncestor()
- getPane()
- Both 1 and 2
- All of the above
Which of the following methods are present in the JScrollPane class in java?
- isWheelScrollingEnabled()
- isScrollingWheelEnabled()
- getScrollsOnExpand()
- Both 1 and 2
- Both 1 and 3
Which of the following methods is/are not present in JComponent class in java?
- isShowing()
- getLocationOnScreen()
- getInsets()
- isOpaque()
- isCircle()
Which of the following methods are present in the JTabbedPane class?
- indexOfTabComponent(Component)
- getTabComponentAt(int)
- setTabComponentAt(int, Component)
- Both 2 and 3
- All of these
Which of the following methods are present in JFormattedTextField Class?
- getAllowsInvalid()
- getOverwriteMode()
- setCommitsOnValidEdit(boolean)
- Both 1 and 2
- All of the above
Which of the following methods are not present in JComponent class in java?
- getComponentGraphics(Graphics g)
- isLightweightComponent(Component c)
- isPaintingTile()
- isPaintingForPrint()
- isPrinting()
How many constructors of WeakHashMap are there in Java collections Framework?
- 6
- 5
- 4
- 3
- 2
Which of the following methods are present in AbstractButton class?
- setTextVerticalPosition(int textPosition)
- setSelectedRolloverIcon(Icon rolloverSelectedIcon)
- setTextHorizontalPosition(int textPosition)
- setDisplayedMnemonicIndex(int index)
- setTextGap(int iconTextGap)
Which of the following methods is not present in AbstractButton class in java?
- setRolloverEnabled(boolean)
- setPressedIcon(Icon)
- setDisabledIcon(Icon)
- setSelectedIcon(Icon)
- setSelectedRolloverIcon(Icon)