简单的模态标识向导 : 向导 « Swing组件 « Java

En
Java
1. 图形用户界面
2. 三维图形动画
3. 高级图形
4. 蚂蚁编译
5. Apache类库
6. 统计图
7. 
8. 集合数据结构
9. 数据类型
10. 数据库JDBC
11. 设计模式
12. 开发相关类
13. EJB3
14. 电子邮件
15. 事件
16. 文件输入输出
17. 游戏
18. 泛型
19. GWT
20. Hibernate
21. 本地化
22. J2EE平台
23. 基于J2ME
24. JDK-6
25. JNDI的LDAP
26. JPA
27. JSP技术
28. JSTL
29. 语言基础知识
30. 网络协议
31. PDF格式RTF格式
32. 映射
33. 常规表达式
34. 脚本
35. 安全
36. Servlets
37. Spring
38. Swing组件
39. 图形用户界面
40. SWT-JFace-Eclipse
41. 线程
42. 应用程序
43. Velocity
44. Web服务SOA
45. 可扩展标记语言
Java 教程
Java » Swing组件 » 向导屏幕截图 
简单的模态标识向导
简单的模态标识向导


package jwizardcomponent.example;

import java.awt.BorderLayout;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import javax.swing.WindowConstants;

import jwizardcomponent.Utilities;
import jwizardcomponent.dialog.*;

/**
 * <p>Title: JWizardComponent</p>
 * <p>Description: Swing-Based Wizard Framework for Wizards</p>
 * <p>Copyright (C) 2003 William Ready
 *
 * <br>This library is free software; you can redistribute it and/or
 * <br>modify it under the terms of the GNU Lesser General Public
 * <br>License as published by the Free Software Foundation; either
 * <br>version 2.1 of the License, or (at your option) any later version.
 *
 * <br>This library is distributed in the hope that it will be useful,
 * <br>but WITHOUT ANY WARRANTY; without even the implied warranty of
 * <br>MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * <br>See the GNU Lesser General Public License for more details.
 *
 * <br>To receive a copy of the GNU Lesser General Public License
 * <br>write to:  The Free Software Foundation, Inc.,
 * <br>59 Temple Place, Suite 330
 * <br>Boston, MA 02111-1307 USA</p>
 *
 @author Jens Kutschke, jens.kutschke@j-dimension.com, http://www.j-dimension.com
 *
 @version 1.0
 */

public class SimpleModalLogoJWizard {
    
    static ImageIcon LOGO;
    
    public static void main(String [] args) {
        try {
            
            // optional: set a look and feel
            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
            
            // create a new frame or use an existing one of your application
            final JFrame mainWindow=new JFrame("Simple demo of a modal wizard with a logo icon.");
            mainWindow.getContentPane().setLayout(new BorderLayout());
            mainWindow.getContentPane().add("North"new JLabel("Click the button to get a modal wizard dialog for this JFrame.", JLabel.CENTER));
            
            // in this example, we use a button to open a new wizard
            JButton dialogButton=new JButton("open modal wizard");
            dialogButton.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent e) {
                    
                    // create the modal wizard: the constructor takes the parent frame
                    SimpleLogoJWizardDialog wizardDialog = new SimpleLogoJWizardDialog(mainWindow, LOGO, true);
                    
                    SwingUtilities.updateComponentTreeUI(wizardDialog);
                    wizardDialog.setTitle("Simple Logo JWizardComponent");
                    
                    // add panels to the wizard
                    wizardDialog.getWizardComponents().addWizardPanel(
                    new SimpleLabelWizardPanel(wizardDialog.getWizardComponents(),
                    new JLabel("This")));
                    wizardDialog.getWizardComponents().addWizardPanel(
                    new SimpleLabelWizardPanel(wizardDialog.getWizardComponents(),
                    new JLabel("is")));
                    wizardDialog.getWizardComponents().addWizardPanel(
                    new SimpleLabelWizardPanel(wizardDialog.getWizardComponents(),
                    new JLabel("a")));
                    wizardDialog.getWizardComponents().addWizardPanel(
                    new SimpleLabelWizardPanel(wizardDialog.getWizardComponents(),
                    new JLabel("modal")));
                    wizardDialog.getWizardComponents().addWizardPanel(
                    new SimpleLabelWizardPanel(wizardDialog.getWizardComponents(),
                    new JLabel("wizard!")));
                    wizardDialog.setSize(500300);
                    wizardDialog.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
                    Utilities.centerComponentOnScreen(wizardDialog);
                    
                    // show the wizard
                    wizardDialog.show();
                }
            });
            mainWindow.getContentPane().add("South", dialogButton);
            mainWindow.setSize(400,  100);
            mainWindow.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            
            LOGO =
            new ImageIcon("images/logo.jpeg");
            
            // show the frame
            mainWindow.show();
            
        catch (Exception e) {
            e.printStackTrace();
        }
    }
    
}

           
       
JWizardComponent.zip( 37 k)
Related examples in the same category
1. Swing Wizard component from yuvraj_sawant(at)persistent.co.in
2. 向导组件的源代码
3. 向导对话框的徽标向导对话框的徽标
4. 动态向导对话框动态向导对话框
5. 简单的动态标识向导简单的动态标识向导
6. 简单的动态向导简单的动态向导
7. 简单的向导
www.java2java.com | Contact Us
Copyright 2010 - 2030 Java Source and Support. All rights reserved.
All other trademarks are property of their respective owners.