Methods Summary |
---|
public static javax.swing.JButton | createButton(java.lang.String text)
JButton button = new JButton(text);
button.setFocusPainted(true);
button.setBorderPainted(true);
button.setContentAreaFilled(true);
return button;
|
public static javax.swing.JButton | createButton(java.lang.String text, java.lang.String icon)
return createButton(text, icon, false);
|
public static javax.swing.JButton | createButton(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.JLabel | createLabel(java.lang.String text, java.lang.String icon)
ImageIcon iconNormal = readImageIcon(icon + ".png");
JLabel label = new JLabel(text, iconNormal, JLabel.CENTER);
return label;
|
public static javax.swing.ImageIcon | readImageIcon(java.lang.String filename)
URL url = UIHelper.class.getResource("images/" + filename);
if (url == null)
return null;
return new ImageIcon(Toolkit.getDefaultToolkit().getImage(url));
|