Here you can find the source of isScrollBarButton(AbstractButton button)
Parameter | Description |
---|---|
button | the button to check |
true
if in scroll bar, false
otherwise
public static boolean isScrollBarButton(AbstractButton button)
//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)); } }