apl/APL2.1/TP6_Dessin/tp06/Ex2.java

31 lines
733 B
Java
Raw Permalink Normal View History

2022-01-14 06:54:18 +01:00
import javax.swing.*;
import java.awt.*;
public class Ex2
{
public static void main(String[] args)
{
int rows = 5;
int lines = 5;
JFrame fenetre = new JFrame();
fenetre.setSize(rows * 100, lines * 100);
fenetre.setMinimumSize(new Dimension(rows * 100, lines * 100));
fenetre.setLocation(100, 100);
fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
GridLayout layout = new GridLayout(lines, rows);
fenetre.setLayout(layout);
for (int i = 0; i < lines; i++)
{
for (int j = 0; j < rows; j++)
{
fenetre.add(new Sablier());
}
}
fenetre.setVisible(true);
}
}