2

I want to create an internal wizard in my Java GUI application such that the clicking of a menu item results in popping up of a wizard that guides the user through a series of steps. I have done lot of research and couldn't find anything with decent enough documentation. Can someone help me out please? Has someone worked on creating a wizard that pops up INSIDE a GUI application?

Thanks in advance!

sk89
  • 51
  • 1
  • 9

2 Answers2

5

You can use cjwizard. It can be embedded inside a JDialog as it is based in JPanel.

And you can see how to use it in https://github.com/cjwizard/cjwizard/blob/master/docs/quickstart.md for example:

   // create the WizardContainer:
   final PageFactory pageFactory = /* create a PageFactory, see the link */;
   final WizardContainer wizard = new WizardContainer(pageFactory)

   // stick the WizardContainer into a dialog:
   final JDialog dialog = new JDialog();
   dialog.getContentPane().add(wizard);
   dialog.pack();
   dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
   dialog.setVisible(true);

Disclaimer: I'm part of the development team.

PhoneixS
  • 10,574
  • 6
  • 57
  • 73
3

If there are no third-party libraries to satisfy the requirements you have then you can just write your own approach. A set of panels, each one having Previous, Next buttons and some of them Finish. The current panel just needs to know which are the previous and the next panels.

Dan D.
  • 32,246
  • 5
  • 63
  • 79