public void paint(Graphics g) { //do this for self-painting editors in Options window - because //we've turned off most property changes, the background won't be //painted correctly otherwise Color c = getBackground(); Color old = g.getColor(); g.setColor(c); g.fillRect(0,0,getWidth(),getHeight()); g.setColor(old); super.paint(g); if (focused) { Color bdr = UIManager.getColor("Tree.selectionBorderColor"); //NOI18N if (bdr == null) { //Button focus color doesn't work on win classic - better to //get the color from a value we know will work - Tim if (getForeground().equals(Color.BLACK)) { //typical bdr = getBackground().darker(); } else { bdr = getForeground().darker(); } } g.setColor(bdr); g.drawRect(1, 1, getWidth() - 3, getHeight() - 3); } g.setColor(old); }
@Override public void paint(Graphics g) { //do this for self-painting editors in Options window - because //we've turned off most property changes, the background won't be //painted correctly otherwise Color c = getBackground(); Color old = g.getColor(); g.setColor(c); g.fillRect(0, 0, getWidth(), getHeight()); g.setColor(old); super.paint(g); if (focused) { Color bdr = UIManager.getColor("Tree.selectionBorderColor"); //NOI18N if (bdr == null) { //Button focus color doesn't work on win classic - better to //get the color from a value we know will work - Tim if (getForeground().equals(Color.BLACK)) { //typical bdr = getBackground().darker(); } else { bdr = getForeground().darker(); } } g.setColor(bdr); g.drawRect(1, 1, getWidth() - 3, getHeight() - 3); } g.setColor(old); }
@Override public void paint(Graphics g) { //do this for self-painting editors in Options window - because //we've turned off most property changes, the background won't be //painted correctly otherwise Color c = getBackground(); Color old = g.getColor(); g.setColor(c); g.fillRect(0,0,getWidth(),getHeight()); g.setColor(old); super.paint(g); if (focused) { Color bdr = UIManager.getColor("Tree.selectionBorderColor"); //NOI18N if (bdr == null) { //Button focus color doesn't work on win classic - better to //get the color from a value we know will work - Tim if (getForeground().equals(Color.BLACK)) { //typical bdr = getBackground().darker(); } else { bdr = getForeground().darker(); } } g.setColor(bdr); g.drawRect(1, 1, getWidth() - 3, getHeight() - 3); } g.setColor(old); }
public void paint(Graphics g) { //do this for self-painting editors in Options window - because //we've turned off most property changes, the background won't be //painted correctly otherwise Color c = getBackground(); Color old = g.getColor(); g.setColor(c); g.fillRect(0,0,getWidth(),getHeight()); g.setColor(old); super.paint(g); if (focused) { Color bdr = UIManager.getColor("Tree.selectionBorderColor"); //NOI18N if (bdr == null) { //Button focus color doesn't work on win classic - better to //get the color from a value we know will work - Tim if (getForeground().equals(Color.BLACK)) { //typical bdr = getBackground().darker(); } else { bdr = getForeground().darker(); } } g.setColor(bdr); g.drawRect(1, 1, getWidth() - 3, getHeight() - 3); } g.setColor(old); }