List of usage examples for javax.swing JComboBox isShowing
public boolean isShowing()
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 .j av a2 s .co 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; }