Displaying a UI after clicking a button
I want to create a new UI within another UI which should be displayed on clicking a button using Java Swing. What should开发者_如何学运维 I do?
In my program on clicking next button I need to display a new UI. How can I link the new ui to the already existing one?
Do you mean wizard like? You can place all your UIs in CardLayout and switch them. Or remove old and add new calling
container.revalidate();
container.repaint();
One approach is to make the second UI not visible from the start.
setVisible(false);
and when you click the button make it visible:
setVisible(true);
精彩评论