List of usage examples for javax.swing JList getDropLocation
@BeanProperty(bound = false) public final DropLocation getDropLocation()
From source file:be.ac.ua.comp.scarletnebula.gui.ServerCellRenderer.java
Color getForegroundColor(final JList list, final int index, final boolean isSelected) { Color foreground;/* w w w. j av a2 s .com*/ // check if this cell represents the current DnD drop location final JList.DropLocation dropLocation = list.getDropLocation(); if (dropLocation != null && !dropLocation.isInsert() && dropLocation.getIndex() == index) { foreground = Color.WHITE; } else if (isSelected) { foreground = UIManager.getColor("Tree.selectionForeground"); } else { foreground = Color.BLACK; } return foreground; }
From source file:be.ac.ua.comp.scarletnebula.gui.ServerCellRenderer.java
Color getBackgroundColor(final JList list, final int index, final boolean isSelected) { Color background;/*from w w w.j a v a 2s . c o m*/ // check if this cell represents the current DnD drop location final JList.DropLocation dropLocation = list.getDropLocation(); if (dropLocation != null && !dropLocation.isInsert() && dropLocation.getIndex() == index) { background = Color.RED; } else if (isSelected) { background = UIManager.getColor("Tree.selectionBackground"); } else { background = Color.WHITE; } return background; }