32 lines
736 B
Java
32 lines
736 B
Java
import javax.swing.*;
|
|
import java.awt.*;
|
|
import java.awt.event.*;
|
|
|
|
|
|
public class MainButton{
|
|
public static void main(String[] args){
|
|
JFrame fenetre = new JFrame()
|
|
; JPanel panneau2 = new JPanel();
|
|
Fond ctrl = new Fond(panneau2);
|
|
|
|
JRadioButton cyan = new JRadioButton("CYAN");
|
|
JRadioButton magenta = new JRadioButton("PINK");
|
|
JRadioButton jaune = new JRadioButton("YELLOW");
|
|
|
|
ButtonGroup grp = new ButtonGroup();
|
|
grp.add(cyan);
|
|
grp.add(magenta);
|
|
grp.add(jaune);
|
|
|
|
cyan.addActionListener(ctrl);
|
|
magenta.addActionListener(ctrl);
|
|
jaune.addActionListener(ctrl);
|
|
|
|
panneau2.add(cyan);
|
|
panneau2.add(magenta);
|
|
panneau2.add(jaune);
|
|
fenetre.add(panneau2, BorderLayout.CENTER);
|
|
fenetre.setVisible(true);
|
|
|
|
}
|
|
} |