I have Meni JFrame which i set invisible, when i call other frame, with button click eg. Reports JFrame, and now how to call, from Reports frame, again same frame Meni which i had before, and not new one.
My code for now is something like this:
Meni
JButton btnReports = new JButton(" Reports");
btnReports.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
Reports r = new Reports();
reports.setVisible(true);
setVisible(false); //setting current JFrame invisible
}
});
Now i want to return to same Meni frame which i earlier set invisible, and not to create a new one, how to do that, ofc if its possible ?
Reports
JButton btnMeni = new JButton(" Meni");
btnMeni.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
//if i do the same like in Meni it will call new window, and
//i don't want that i simply want to setVisible Meni window again
dispose();
}
});
Thanks !