tags:

views:

388

answers:

5

Hi All, I am new to Swing. I am trying to develop an application using Swing. I have managed to create the first page of my application. Now what I want to do is to traverse to a new page, using the next button. But am not able to find a way to do it using Swing. Also, if I click the previous button, would I be able to get the data that I had entered in the text boxes or selected using radio buttons on the previous page. I think this can be done pretty easily in Struts, but how is this to be achieved using Swing.

Please do help.

Thanks a lot.

+1  A: 

I assume you're trying to build a wizard-style swing dialog? swing does not offer an out-of-the-box framework for this type of task (but of course it offers all UI elements/controls that you will need to create one). just google for "swing wizard framework" and you will find plenty of inspiration -- unfortunately, i can't recommend a single best one (at my company, we have written our own), but i am confident that you will either find one that will work for you or you will familiarize with some patterns that will help you to write one yourself -- good luck!

netzwerg
A: 

This one is old but might just get you started: http://java.sun.com/developer/technicalArticles/GUI/swing/wizard/

Simon Groenewolt
Hi Simon, using the linki am bale to hv wizard, but suppose i hv entered some value on screen1 and then i move to screen2,and on basis on screen1 i have to display some values on screen2, how do I get the values set in screen 1 in screen2 using the same code given in the link u have mentioned.
NewToJava
I do not now how to do it in that specific situation, just make sure you store your data in a place that is accessible from both the screens, if there is currently none then make sure to give both the screens a reference to a third object and store it there.
Simon Groenewolt
A: 

You can create different views like "Login", "Configuration", "MainPage". The views will contain all components you want to show at the screen. You can implement a ViewManager who can handle this views (Show one of the views).

At the bottom of the Main Frame you can add a Button area, where the forware/backward buttons are placed. At the center of the frame you will show the views.

When the button are selected the ViewManager decideds which view is set to visible. From the ViewManager you can get every information from the views you want.

The views can enter the ViewManager and can get the information they need from another view.

Markus Lausberg
Hi Markus, But wouldn't all this view management be in context of a web app? I am developing a desktop application and want to manage the same there.
NewToJava
A: 

Hi Simon, I am using the link you have sent. The basic motive is achieved on having a wizard, but now i m stuck at a point. The problem is... suppose i have entered some value on screen 1 and then i move to screen 2.. and on basis on screen 1 i have to display some values on screen 2.. how do I get the values set in screen 1 in screen2 using the same code given in the link u have mentioned.

NewToJava