@Override public void paint(Graphics g) { if (isRightToLeft()) { Dimension size = getSize(); // Then the icon. if (editingIcon != null) { int yLoc = Math.max(0, (size.height - editingIcon .getIconHeight()) / 2); int xLoc = Math.max(0, size.width - offset); editingIcon.paintIcon(this, g, xLoc, yLoc); } // need to prevent super from painting the icon Icon rememberIcon = editingIcon; editingIcon = null; super.paint(g); editingIcon = rememberIcon; } else { super.paint(g); } }
@Override public void paint(Graphics g) { if (isRightToLeft()) { Dimension size = getSize(); // Then the icon. if (editingIcon != null) { int yLoc = Math.max(0, (size.height - editingIcon .getIconHeight()) / 2); int xLoc = Math.max(0, size.width - offset); editingIcon.paintIcon(this, g, xLoc, yLoc); } // need to prevent super from painting the icon Icon rememberIcon = editingIcon; editingIcon = null; super.paint(g); editingIcon = rememberIcon; } else { super.paint(g); } }
@Override public void paint(Graphics g) { if (isRightToLeft()) { Dimension size = getSize(); // Then the icon. if (editingIcon != null) { int yLoc = Math.max(0, (size.height - editingIcon .getIconHeight()) / 2); int xLoc = Math.max(0, size.width - offset); editingIcon.paintIcon(this, g, xLoc, yLoc); } // need to prevent super from painting the icon Icon rememberIcon = editingIcon; editingIcon = null; super.paint(g); editingIcon = rememberIcon; } else { super.paint(g); } }
@Override public void paint(Graphics g) { if (isRightToLeft()) { Dimension size = getSize(); // Then the icon. if (editingIcon != null) { int yLoc = Math.max(0, (size.height - editingIcon .getIconHeight()) / 2); int xLoc = Math.max(0, size.width - offset); editingIcon.paintIcon(this, g, xLoc, yLoc); } // need to prevent super from painting the icon Icon rememberIcon = editingIcon; editingIcon = null; super.paint(g); editingIcon = rememberIcon; } else { super.paint(g); } }
@Override public void paint(Graphics g) { if (isRightToLeft()) { Dimension size = getSize(); // Then the icon. if (editingIcon != null) { int yLoc = Math.max(0, (size.height - editingIcon .getIconHeight()) / 2); int xLoc = Math.max(0, size.width - offset); editingIcon.paintIcon(this, g, xLoc, yLoc); } // need to prevent super from painting the icon Icon rememberIcon = editingIcon; editingIcon = null; super.paint(g); editingIcon = rememberIcon; } else { super.paint(g); } }