Forum Stats

  • 3,855,060 Users
  • 2,264,457 Discussions


Card Layout vs. ContenPane

843807 Member Posts: 46,582
edited Sep 30, 2002 12:34PM in Java Applet Development
I'm developing an applet which has two screens. An initial screen which accepts data from the user and then a second screen which returns results. I'm wondering what the best way to code this would be. I've thought of two options, using a card layout, or two content panes and then setting them appropriately. Which is the better option?


  • 843807
    843807 Member Posts: 46,582
    If u r using 2 different screens,make them into 2 different applets and go for interapplet communication.This might be a cumbersome way but it will definitely work.The only condition would be that the 2 applets should reside in the same CODEBASE.Use NAME tag in the HTML file,so that u can use getApplet(String) method of AppletContext interface to get reference to the applet.
    Applet app1 = getAppletContext().getApplet("Applet2");

    If this doesn't work go for Tabbed Panes which will offer a good solution
  • 843807
    843807 Member Posts: 46,582
    Doesn't it make more sense to use a cardLayout or to set the contentPane then to make two seperate applets?
This discussion has been closed.