MissKami
Messages postés
4
Date d'inscription
vendredi 25 avril 2008
Statut
Membre
Dernière intervention
5 mai 2008
30 avril 2008 à 20:03
voici mon code:
import
javax.swing.SwingUtilities;
import
java.awt.BorderLayout;
import
javax.swing.JPanel;
import
javax.swing.JFrame;
import
javax.swing.JTextField;
import
javax.swing.JButton;
import
javax.swing.JLabel;
import
javax.swing.JOptionPane;
import
javax.swing.JTable;
import
java.awt.Rectangle;
import
java.awt.Dimension;
import
javax.swing.event.*;
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
;
}
}