Récupérer les valeurs d'une autre class
bonjour,
j'ai un soucis avec mon code je n'arrive pas à récupérer l'id et le password que j'envois depuis une autre class. Je ne comprend pas pourquoi.
merci d'avance pour vos réponses ;)
Code:
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
|
public class Accountend extends javax.swing.JFrame {
protected int idu;
protected String password;
/**
* Creates new form Accountend
*/
public Accountend() {
initComponents();
}
public Accountend(int id, String pass) {
initComponents();
idu = id;
password = pass;
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
// <editor-fold defaultstate="collapsed" desc="Generated
// Code">//GEN-BEGIN:initComponents
private void initComponents() {
String id;
jToggleButton1 = new javax.swing.JToggleButton();
jPanel1 = new javax.swing.JPanel();
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jTextField1 = new javax.swing.JTextField();
jLabel3 = new javax.swing.JLabel();
jTextField2 = new javax.swing.JTextField();
jLabel4 = new javax.swing.JLabel();
jButton1 = new javax.swing.JButton();
jToggleButton1.setText("jToggleButton1");
jToggleButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jToggleButton1ActionPerformed(evt);
}
});
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setLocation(new java.awt.Point(430, 160));
jLabel1.setFont(new java.awt.Font("Lucida Grande", 3, 18)); // NOI18N
jLabel1.setText("To recap");
id = String.valueOf(idu);
jLabel2.setText(id);
jLabel3.setText(password);
jLabel4.setFont(new java.awt.Font("Lucida Grande", 2, 13)); // NOI18N
jLabel4.setText("Thank You For Your First Connection ");
jButton1.setText("Click Here To Login ");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
}); |