Search code examples
javaswingmodel-view-controllerlayout-managerjapplet

JApplet multiple pages application


I want to build a JApplet application, consists of 5 pages. Given data in one page will be input for next page. Based on given data I have to show different options in next page.

I am completely new to applets, previously worked with web applications. I need something similar to MVC but should completely with applets (Swing JApplet). Is there any framework like struts to implement it?

Please give me some ideas. How do I proceed?


Solution

  • For me it's something like wizard.

    I would define a cutom model class storing data for each page and define 5 JPanels to represent the model's data for each step.

    Then all the 5 panels should be placed in a container with CardLayout.

    Moving to the next step reads current step data, stores the data in model and prepares the model's data for the next step.

    After that card swapped and new step's panel is shown reflected prepared data from the model.