Take the 2-minute tour ×  Im using swing in java to make a quiz
for my coursework. I have made my main class, a tabbed frame
that holds separate jpanels as tabs for example the login page,
and im using sqlite to get my data. However Im struggling to see
how i can communicate between say my login jpanel and my main
class.  mainJFrame.addWindowListener(new WindowAdapter() {
public void windowActivated(WindowEvent arg0) {
LoginPanel loginEntry = new LoginPanel();  //So here i would
like an if statement so that on successful login, the other tabs
are added and can be seen. But are not available if you are not
logged in.                  tabbedPane.addTab("Quick Guide",
null, quickGuidePanel, null);
tabbedPane.addTab("Examples", null, examplePanel, null);
tabbedPane.addTab("Run Quiz", null, runQuizPanel, null);
tabbedPane.addTab("Exams", null, examPanel, null);
tabbedPane.addTab("View Performance", null, viewPerfPanel,
null);