public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { JInternalFrame jif = null; if (c instanceof JInternalFrame) { jif = (JInternalFrame) c; } else if (c instanceof JInternalFrame.JDesktopIcon) { jif = ((JInternalFrame.JDesktopIcon) c).getInternalFrame(); } else { return; } if (jif.isSelected()) { // Set the line color so the line border gets the correct // color. lineColor = activeColor; super.paintBorder(c, g, x, y, width, height); } else { lineColor = inactiveColor; super.paintBorder(c, g, x, y, width, height); } }
// Returns true if the associated internal frame has focus. protected boolean isActiveFrame() { return frame.isSelected(); }