1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
import java.awt.*;
import javax.swing.ImageIcon;
import javax.swing.JButton;
public class Puzzle extends Frame
{
Puzzle (String s){
super(s);
setSize (300, 200);
setLayout (new GridLayout (4,4));
for (int i = 0; i<12; i++){
JButton bouton = new JButton();
add(new JButton (""+ i));
bouton.setIcon(new ImageIcon("/images/puzzleimage1.jpg"));
setVisible(true);
}
}
public Puzzle(boolean b, Grille grille) {
// TODO Auto-generated constructor stub
}
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
new Puzzle ("Exemple");
}
} |
Partager