Example usage for javax.swing JList isShowing

List of usage examples for javax.swing JList isShowing

Introduction

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

Prototype

public boolean isShowing() 

Source Link

Document

Determines whether this component is showing on screen.

Usage

From source file:Main.java

static ImageIcon makeImageIcon(URL url, JComboBox combo, int row) {
    ImageIcon icon = new ImageIcon(url);
    icon.setImageObserver(new ImageObserver() {
        public boolean imageUpdate(Image img, int infoflags, int x, int y, int w, int h) {
            if (combo.isShowing() && (infoflags & (FRAMEBITS | ALLBITS)) != 0) {
                if (combo.getSelectedIndex() == row) {
                    combo.repaint();/*w w w. ja  va  2s.c o m*/
                }
                BasicComboPopup p = (BasicComboPopup) combo.getAccessibleContext().getAccessibleChild(0);
                JList list = p.getList();
                if (list.isShowing()) {
                    list.repaint(list.getCellBounds(row, row));
                }
            }
            return (infoflags & (ALLBITS | ABORT)) == 0;
        };
    });
    return icon;
}