Example usage for javax.swing JList getClientProperty

List of usage examples for javax.swing JList getClientProperty

Introduction

In this page you can find the example usage for javax.swing JList getClientProperty.

Prototype

public final Object getClientProperty(Object key) 

Source Link

Document

Returns the value of the property with the specified key.

Usage

From source file:Main.java

/**
 *
 * @param list/*ww  w. j a  v a2 s  .  c o m*/
 * @param point
 * @return
 */
public static int loc2IndexFileList(JList list, Point point) {
    int index = list.locationToIndex(point);

    if (index != -1) {
        Object bySize = list.getClientProperty("List.isFileList");

        if (bySize instanceof Boolean && ((Boolean) bySize).booleanValue()
                && !pointIsInActualBounds(list, index, point)) {
            index = -1;
        }
    }

    return index;
}