List of usage examples for javax.swing JLayeredPane getLayer
public int getLayer(Component c)
From source file:LayeredPaneDemo4.java
public void setSelected(boolean b) { if (b) {/*from ww w . j a v a 2 s . co m*/ if (m_selected != true && getParent() instanceof JLayeredPane) { JLayeredPane jlp = (JLayeredPane) getParent(); int layer = jlp.getLayer(this); Component[] components = jlp.getComponentsInLayer(layer); for (int i = 0; i < components.length; i++) { if (components[i] instanceof InnerFrame) { InnerFrame tempFrame = (InnerFrame) components[i]; if (!tempFrame.equals(this)) tempFrame.setSelected(false); } } m_selected = true; updateBorderColors(); updateTitleBarColors(); getGlassPane().setVisible(false); repaint(); } } else { m_selected = false; updateBorderColors(); updateTitleBarColors(); getGlassPane().setVisible(true); repaint(); } }