public void paintComponent (Graphics g) { //For property panel usage, allow the editor to paint if (editor != null && !hasFocus() && editor.isPaintable()) { Insets ins = getInsets(); Color c = g.getColor(); try { g.setColor(getBackground()); g.fillRect(0,0,getWidth(),getHeight()); } finally { g.setColor(c); } ins.left += PropUtils.getTextMargin(); editor.paintValue(g, new Rectangle(ins.left, ins.top, getWidth() - (ins.right + ins.left), getHeight() - (ins.top + ins.bottom))); } else { super.paintComponent(g); } } }
public void paintComponent (Graphics g) { //For property panel usage, allow the editor to paint if (editor != null && !hasFocus() && editor.isPaintable()) { Insets ins = getInsets(); Color c = g.getColor(); try { g.setColor(getBackground()); g.fillRect(0,0,getWidth(),getHeight()); } finally { g.setColor(c); } ins.left += PropUtils.getTextMargin(); editor.paintValue(g, new Rectangle(ins.left, ins.top, getWidth() - (ins.right + ins.left), getHeight() - (ins.top + ins.bottom))); } else { super.paintComponent(g); } } }
@Override public void paintComponent(Graphics g) { //For property panel usage, allow the editor to paint if ((editor != null) && !hasFocus() && editor.isPaintable()) { Insets ins = getInsets(); Color c = g.getColor(); try { g.setColor(getBackground()); g.fillRect(0, 0, getWidth(), getHeight()); } finally { g.setColor(c); } ins.left += PropUtils.getTextMargin(); editor.paintValue( g, new Rectangle( ins.left, ins.top, getWidth() - (ins.right + ins.left), getHeight() - (ins.top + ins.bottom) ) ); } else { super.paintComponent(g); } }