a
This commit is contained in:
34
APL2.1/TP6_Dessin/tp06/Ex4.java
Normal file
34
APL2.1/TP6_Dessin/tp06/Ex4.java
Normal file
@@ -0,0 +1,34 @@
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
|
||||
public class Ex4
|
||||
{
|
||||
public static void main(String[] args)
|
||||
{
|
||||
|
||||
JFrame fenetre = new JFrame();
|
||||
|
||||
fenetre.setSize(500, 500);
|
||||
fenetre.setMinimumSize(new Dimension(500, 500));
|
||||
fenetre.setLocation(100, 100);
|
||||
fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
|
||||
GridLayout layout = new GridLayout(5, 5);
|
||||
fenetre.setLayout(layout);
|
||||
|
||||
int green = 0;
|
||||
|
||||
for (int i = 0; i < 5; i++)
|
||||
{
|
||||
int blue = 0;
|
||||
green += 51;
|
||||
for (int j = 0; j < 5; j++)
|
||||
{
|
||||
blue += 51;
|
||||
fenetre.add(new Cercle(new Color(0, green, blue)));
|
||||
}
|
||||
}
|
||||
|
||||
fenetre.setVisible(true);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user