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 34
| package helloword;
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import java.util.*;
public class Fenetre {
public class FenetreSansReaction extends JFrame {
private JLabel label = new JLabel("Ma deuxieme fenêtre qui ne réagit pas");
private JButton jOK = new JButton("Valider l'opération");
private JComboBox combos = new JComboBox();
public FenetreSansReaction(String titre) {
super(titre);
Container pane = this.getContentPane();
pane.add(this.label, BorderLayout.NORTH);
pane.add(this.jOK, BorderLayout.SOUTH);
}
}
public static void main(String[] args) {
JFrame frame = new FenetreSansReaction("Ma deuxieme fenetere");
frame.setVisible(true);
frame.setSize(600, 500);
frame.setLocationRelativeTo(null);
}
} |
Partager