Rectangle tr = new Rectangle(); Rectangle ir = new Rectangle(); Rectangle vr = new Rectangle();
Font saved_font = g.getFont();
    public void paint(Graphics g, JComponent c)    {      	JLabel b = (JLabel) c;	Rectangle tr = new Rectangle();	Rectangle ir = new Rectangle();	Rectangle vr = new Rectangle();        Font f = c.getFont();        g.setFont(f);        FontMetrics fm = SwingUtilities.getFontMetrics(f);        Insets i = c.getInsets();	Rectangle bound = c.getBounds();		System.out.println("BOUND=" + bound + ", insets = " + i + ", " + b.getText());		if (bound == null)	    {		vr.x      = i.left;		vr.y      = i.top;		vr.width  = b.getWidth() - (i.right  + i.left);		vr.height = b.getHeight() - (i.bottom + i.top);	    }	else	    {		vr.x      = bound.x + i.left;		vr.y      = bound.y + i.top;		vr.width  = bound.width - (i.right  + i.left);		vr.height = bound.height - (i.bottom + i.top);	    }	System.out.println("             VIEW-RECT-JLABEL="+vr+", insets="+i+", FONTM="+fm);	String text = SwingUtilities.layoutCompoundLabel(c,							 fm, 							 b.getText(),							 b.getIcon(),							 b.getVerticalAlignment(), 							 b.getHorizontalAlignment(),							 b.getVerticalTextPosition(), 							 b.getHorizontalTextPosition(),							 vr,							 ir,							 tr,							 gap);	paintIcon(g, c, ir);	paintText(g, c, tr, b.getText());	paintFocus(g, c, vr, tr, ir);    }