Code example for JLabel

Methods: getPreferredSize

0
        } 
        return this;
    } 
     
    public Dimension getPreferredSize() {
        Dimension iconD = _icon.getPreferredSize();
        Dimension textD = _text.getPreferredSize();
        int height = iconD.height < textD.height ?
        textD.height : iconD.height;
        return new Dimension(iconD.width + textD.width, height);
    } 
     
    public void setBackground(Color color) {
        if (color instanceof ColorUIResource)
            color = null;
        super.setBackground(color);
    } 
     
    class TreeTextArea extends JTextArea {
        /**