photoshop打开图片。改变大小,另存为。然后再使用就可以了。我是苯办法。不知可有简单办法吗。
up。

解决方案 »

  1.   

    button.setMargin(new Insets(0,0,0,0));
      

  2.   

    button.setMargin(new Insets(0,0,0,0));
    --------ok!
      

  3.   

    add the character into save.gif;
      

  4.   

    自己用JPanel写一个按钮,这个效果比较好,你以后也可以重用。
      

  5.   

    //用setBorder()方法来设置有图片的按钮边框,可用各种边框的效果import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;public class Test extends JFrame {
      JPanel pane;  public Test() {
        super("ICON Button");
        this.addWindowListener(new WindowAdapter() {
          public void windowClosing(WindowEvent windowEvent) {
            System.exit(0);
          }
        });
        ImageIcon image = new ImageIcon("./classes/test/icon.gif");
        JButton button = new JButton();
        button.setIcon(image);
        button.setBorder(BorderFactory.createMatteBorder(0, 0, 0, 0, new Color(0, 0, 0)));
        pane = new JPanel();
        pane.add(button);
        this.getContentPane().add(pane);
        this.setSize(200, 150);
        this.setVisible(true);
      }
      public static void main(String[] args) {
        new Test();
      }
    }
      

  6.   

    远没有VCL自定义方便,JAVA垃圾
      

  7.   

    button.setMargin(new Insets(0,0,0,0));
    这是最好的办法