2007年6月19日 星期二

Java Exercise For ImageIcon

package test;

import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;

public class Test extends JFrame{
ImageIcon img = new ImageIcon("123456.jpg");
Test(){

JButton abc = new JButton("mo mo ",img);

this.add(abc);
this.setVisible(true);



}
public static void main(String[] args) {
Test a = new Test();
}

}

沒有留言: