创建向导Swing [英] Creating Wizard Swing

查看:162
本文介绍了创建向导Swing的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用swing制作一个向导。我注意到JOptionPane就像向导一样工作,只有输入的数量和组织的方式是有限的。

I want to make a wizard using swing. I noticed that JOptionPane works just like a wizard, only the amount of input and the manner on which it is organized is limited.

在给出所需的输入并按下右键之前,有人知道JOptionPane如何等待吗?

Does anyone know how JOptionPane "waits" until the required input is given and the right button is pressed before returning the value at the end?

有没有人知道如何使用JOptionPane以便可以创建向导的典型cardLayout?

Does anyone know how to use JOptionPane so that the typical cardLayout of a wizard can be created?

推荐答案

您可以将任意内容添加到 JOptionPane ,如此处。该内容可以是具有 CardLayout 的面板,如此处所示。给定 JOptionPane.OK_CANCEL_OPTION JOptionPane 将等待,直到单击任一按钮。如果结果是 JOptionPane.OK_OPTION ,您可以根据需要检查卡片的内容。

You can add arbitrary content to a JOptionPane, as shown here. That content can be a panel having CardLayout, as shown here. Given the JOptionPane.OK_CANCEL_OPTION, JOptionPane will wait until either button is clicked. If the result is JOptionPane.OK_OPTION, you can examine the cards' content as required.

这篇关于创建向导Swing的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆