:sad: I have a CardLayout and a main panel to which I have added the panels I want to display. However, I cannot add the CardLayout to the JFrame using getContentPane()
. I tried adding the application in which all my screen building takes place to getContentPane()
but to no avail. Here is my code:
public static void main (String args[]) {
f = new JFrame("My Supplier List System");
TestClient application = new TestClient();
f.getContentPane().add(application, BorderLayout.CENTER);
f.pack();
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
This is my error:
C:\myjava\TestClient.java:323: cannot resolve symbol
symbol : method add (TestClient,java.lang.String)
location: class java.awt.Container
f.getContentPane().add(application, BorderLayout.CENTER);
^
1 error