FileDocCategorySizeDatePackage
UIHelper.javaAPI DocExample1803Mon Jan 09 11:02:00 GMT 2006None

UIHelper

public final class UIHelper extends Object

Fields Summary
Constructors Summary
Methods Summary
public static javax.swing.JButtoncreateButton(java.lang.String text)

        JButton button = new JButton(text);
        button.setFocusPainted(true);
        button.setBorderPainted(true);
        button.setContentAreaFilled(true);
        return button;
    
public static javax.swing.JButtoncreateButton(java.lang.String text, java.lang.String icon)

        return createButton(text, icon, false);
    
public static javax.swing.JButtoncreateButton(java.lang.String text, java.lang.String icon, boolean flat)

        ImageIcon iconNormal = readImageIcon(icon + ".png");
        ImageIcon iconHighlight = readImageIcon(icon + "_highlight.png");
        ImageIcon iconPressed = readImageIcon(icon + "_pressed.png");

        JButton button = new JButton(text, iconNormal);
        button.setFocusPainted(!flat);
        button.setBorderPainted(!flat);
        button.setContentAreaFilled(!flat);
        if (iconHighlight != null) 
        {
            button.setRolloverEnabled(true);
            button.setRolloverIcon(iconHighlight);
        }
        if (iconPressed != null)
            button.setPressedIcon(iconPressed);
        return button;
    
public static javax.swing.JLabelcreateLabel(java.lang.String text, java.lang.String icon)

        ImageIcon iconNormal = readImageIcon(icon + ".png");
        JLabel label = new JLabel(text, iconNormal, JLabel.LEFT);
        return label;
    
public static javax.swing.ImageIconreadImageIcon(java.lang.String filename)

        return new ImageIcon(Toolkit.getDefaultToolkit().getImage(UIHelper.class.getResource("images/" + filename)));