I have two JFrames, in my second one I added a private String and made a setter() for it:
public class FProduit extends javax.swing.JFrame {
private String CAT;
public void setCAT(String C) {
this.CAT = C;
}
/*
***
*/
}
in my First JFrame, I have this:
FProduit Fp=new FProduit();
String cat=ButtonDisplay.getText().toString();
JOptionPane.showMessageDialog(null,cat);
Fp.setCAT(cat);
Fp.setVisible(true);
Which displays my String cat,and calls the second JFrame but when I try to display it in my SECOND Jframe, like this:
public FProduit() {
initComponents();
JOptionPane.showMessageDialog(null,this.CAT);
}
all I get is a null String.