dkim18
asked on
Switching screens on applet
Hi!
I am making a wizard to bring up the plotting utility for graph and I am wondering how to accomplish the following behavior of the wizard screen. When a user clicks ‘next’ button, the entire JLabels and JTextFields should change to next screen without switching panel.
If you visit the following site and click ‘next’ button when the sample wizard shows up, you will understand what I am talking about.
http://webdev.apl.jhu.edu/~rbe/java/Homework5/index.html
Any ideas?
Thanks in advance
I am making a wizard to bring up the plotting utility for graph and I am wondering how to accomplish the following behavior of the wizard screen. When a user clicks ‘next’ button, the entire JLabels and JTextFields should change to next screen without switching panel.
If you visit the following site and click ‘next’ button when the sample wizard shows up, you will understand what I am talking about.
http://webdev.apl.jhu.edu/~rbe/java/Homework5/index.html
Any ideas?
Thanks in advance
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
> I am wondering how to accomplish the following behavior of the wizard screen.
> When a user clicks ‘next’ button, the entire JLabels and JTextFields should
> change to next screen without switching panel.
Actually, I think thats the correct way of making a wizard because thats also what I do. What I mean
is I created a 1st panel w/ all of its components and then if I press next, I set the 1st panel to
setVisible(false); and what I do is to add the next set of panel's to the screen and showing it
by calling the method setVisible(true).
On the back button or back action however what I do is to call setVisible(true); from the 1st panel
and setVisible(false); from the last panel. So that everything could work fine.
In case you dont wanna to use panels you can just use the method setVisible(boolean); from any
components in your program.
Hope that helps . . .
Javatm
> When a user clicks ‘next’ button, the entire JLabels and JTextFields should
> change to next screen without switching panel.
Actually, I think thats the correct way of making a wizard because thats also what I do. What I mean
is I created a 1st panel w/ all of its components and then if I press next, I set the 1st panel to
setVisible(false); and what I do is to add the next set of panel's to the screen and showing it
by calling the method setVisible(true).
On the back button or back action however what I do is to call setVisible(true); from the 1st panel
and setVisible(false); from the last panel. So that everything could work fine.
In case you dont wanna to use panels you can just use the method setVisible(boolean); from any
components in your program.
Hope that helps . . .
Javatm
I think there is many ways to tackle this ...one is e.g (but not that impressing..hehe)
maybe you could save the actual strings(title or whatever) for the lables in a array and call the appropriate one when needed.
For Jtextfields you could play with setting the setVisible(boolean) to hide
the jtextfields that you dont want to show...etc..
hope this helps..
Cheers!