I want to store the variable (id_Category) between my two JPanels because I need the value to work on it on the second Jpanel This the first JPanel
public class PreparerTest extends JPanel
int idCategorie;
public void mouseClicked(MouseEvent e) {
idCategorie = categories.get(table.getSelectedRow()).getId();
the second JPanel
public class PreparerTestManuelle extends JPanel {
JButton btnAfficher = new JButton("Afficher");
btnAfficher.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
questions=GestionTestDelegate.doPrepareManuallyTest(the id is supposed to be here, nombreQuestion.getText());
}
});