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 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147
|
public class Interfacee extends JFrame {
private static final long serialVersionUID = 1L;
private JPanel jContentPane = null;
private JTextField jTextField_long = null;
private JTextField jTextField_dim = null;
private JLabel jLabel = null;
private JButton jButton = null;
private JLabel jLabel1 = null;
private JLabel jLabel2 = null;
private JTable Table = null;
private JLabel jLabel3 = null;
private JTextField getJTextField_long() {
if (jTextField_long == null) {
jTextField_long = new JTextField();
jTextField_long.setText("");
jTextField_long.setBounds(new Rectangle(216, 5, 43, 20));
}
return jTextField_long;
}
private JTextField getJTextField_dim() {
if (jTextField_dim == null) {
jTextField_dim = new JTextField();
jTextField_dim.setText("");
jTextField_dim.setBounds(new Rectangle(222, 60, 41, 20));
}
return jTextField_dim;
}
private JButton getJButton() {
if (jButton == null) {
jButton = new JButton();
jButton.setText("ok");
jButton.setBounds(new Rectangle(158, 209, 67, 22));
jButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
int n = Integer.parseInt(jTextField_long.getText());
int k = Integer.parseInt(jTextField_dim.getText());
System.out.println(n);
JOptionPane.showMessageDialog(null, "les mots du code sont:");
}
});
jButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
}
});
}
return jButton;
}
private JTable getTable() {
if (Table == null) {
Table = new JTable();
Table.setBounds(new Rectangle(68, 119, 268, 80));
Table.setCellSelectionEnabled(false);
Table.setShowGrid(true);
Table.setEnabled(false);
Table.setCellSelectionEnabled(true);
Table.setCellEditor(null);
}
return Table;
}
public static void main(String[] args) {
// TODO Raccord de méthode auto-généré
SwingUtilities.invokeLater(new Runnable() {
public void run() {
Interfacee thisClass = new Interfacee();
thisClass.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
thisClass.setVisible(true);
}
});
}
public Interfacee() {
super();
initialize();
}
private void initialize() {
this.setSize(434, 273);
this.setContentPane(getJContentPane());
this.setTitle("projet_code");
this.setVisible(true);
}
private JPanel getJContentPane() {
if (jContentPane == null) {
jLabel3 = new JLabel();
jLabel3.setBounds(new Rectangle(69, 98, 262, 16));
jLabel3.setText("Veuillez entrer la matrice génératrice:");
jLabel2 = new JLabel();
jLabel2.setBounds(new Rectangle(106, 47, 5, 15));
jLabel2.setText("Veullez entrer la longueur du code:");
jLabel1 = new JLabel();
jLabel1.setBounds(new Rectangle(2, 53, 215, 33));
jLabel1.setText("Veuillez entrer la dimension du code:");
jLabel = new JLabel();
jLabel.setText("Veuillez entrer la longueur du code:");
jLabel.setBounds(new Rectangle(0, -1, 207, 28));
jContentPane = new JPanel();
jContentPane.setLayout(null);
jContentPane.add(getJTextField_dim(), null);
jContentPane.add(getJTextField_long(), null);
jContentPane.add(jLabel, null);
jContentPane.add(getJButton(), null);
jContentPane.add(jLabel1, null);
jContentPane.add(jLabel2, null);
JTable Table = new JTable();
Table.setLayout(null);
jContentPane.add(Table, null);
jContentPane.add(getTable(), null);
jContentPane.add(jLabel3, null);
}
return jContentPane;
}
} |
Partager