photoshop打开图片。改变大小,另存为。然后再使用就可以了。我是苯办法。不知可有简单办法吗。
up。
up。
解决方案 »
- 手動觸發一個鍵盤事件
- 下载管理类出现异常?如何解决!谢谢
- 关于Class.forName、Class.class(属性)、getClass()的问题
- 界面调用问题
- 熟悉socket和tomcat的请进!
- 帮忙解决jsp连接 mysql出现的错误提示??加分
- Java中用什么类实现定时功能?
- abstract的method为什么不能试static,native,以及syncgronized的?
- 使用javah -jni 生成C++的的 .h 文件
- JDK8之The type java.util.Map$Entry cannot be resolved
- 请问让一个永远运行的线程结束是用一个boolean控制好,还是用捕捉InterruptedException的方法好呢。
- JOptionPane这个类怎么用?
--------ok!
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();
}
}
这是最好的办法