Java JButton Settings isScrollBarButton(AbstractButton button)

Here you can find the source of isScrollBarButton(AbstractButton button)

Description

Checks and answers if the specified button is in a scroll bar.

License

Open Source License

Parameter

Parameter Description
button the button to check

Return

true if in scroll bar, false otherwise

Declaration

public static boolean isScrollBarButton(AbstractButton button) 

Method Source Code

//package com.java2s;
import java.awt.*;

import javax.swing.*;

public class Main {
    /**//w w  w .  j  a v  a  2  s  .c  o m
     * Checks and answers if the specified button is in a scroll bar.
     * 
     * @param button
     *            the button to check
     * @return <code>true</code> if in scroll bar, <code>false</code> otherwise
     */
    public static boolean isScrollBarButton(AbstractButton button) {
        Container parent = button.getParent();
        return (parent != null)
                && ((parent instanceof JScrollBar) || (parent.getParent() instanceof JScrollBar));
    }
}

Related

  1. hasIcon(AbstractButton button)
  2. hasText(AbstractButton button)
  3. hideApproveButton(JFileChooser fileChooser)
  4. hideJFileChooserButtons(JFileChooser sessionFileChooser)
  5. interButtonSpace()
  6. isSelected(AbstractButton... buttons)
  7. isSelected(final AbstractButton abstractButton)
  8. isSelected(final AbstractButton abstractButton)
  9. lookupButton(Container c, String text)