zoukankan      html  css  js  c++  java
  • java Swing弹出对话框

    JOptionPane,该类为程序中显示弹出对话框,
    输入对话框:包括一个文本字段和两个按钮,确定和取消;
    showInputDialog(Object message) 显示请求用户输入的问题消息对话框。
    showInputDialog(Object message, Object initialSelectionValue)   显示请求用户输入的问题消息对话框,它带有已初始化为 initialSelectionValue 的输入值。
    showInputDialog(Component parentComponent, Object message, Object initialSelectionValue) 显示请求用户输入内容的问题消息对话框,它以 parentComponent 为父级。
    showInputDialog(Component parentComponent, Object message, String title, int messageType) 显示请求用户提供输入的对话框,它以 parentComponent 为父级,该对话框的标题为 title,消息类型为 messageType。
    确认对话框:包括确定和取消或是和否两按钮;
    showConfirmDialog(Component parentComponent, Object message) 调出带有选项 Yes、No 和 Cancel 的对话框;
    showConfirmDialog(Component parentComponent, Object message, String title, int optionType)
    showConfirmDialog(Component parentComponent, Object message, String title, int optionType, int messageType)   调用一个由 optionType 参数确定其中选项数的对话框,messageType 参数确定要显示的图标。
    取消对话框:
    showMessageDialog(Component parentComponent, Object message) 调出标题为 "Message" 的信息消息对话框。
    showMessageDialog(Component parentComponent, Object message, String title, int messageType) 调出对话框,它显示使用由 messageType 参数确定的默认图标的 message。
    showMessageDialog(Component parentComponent, Object message, String title, int messageType, Icon icon) 调出一个显示信息的对话框,为其指定了所有参数。
    选择对话框:
    showOptionDialog(Component parentComponent, Object message, String title, int optionType, int messageType, Icon icon, Object[] options, Object initialValue)
              调出一个带有指定图标的对话框,其中的初始选择由 initialValue 参数确定,选项数由 optionType 参数确定。


    message    要显示的消息。messageType 消息类型。initialValue   应该在 options 中最初选择的值。icon   在窗格中使用的图标。options 要向用户显示的选项。

    optionType    选项类型,DEFAULT_OPTION、YES_NO_OPTION、YES_NO_CANCEL_OPTION 或 OK_CANCEL_OPTION 之一。 title   对话框的标题。
    parentComponent 定义作为此对话框的父对话框的 Component。通过两种方式使用此参数:包含它的 Frame 可以用作对话框的父 Frame,在对话框的位置使用其屏幕坐标。
                   一般情况下,将对话框紧靠组件置于其之下。此参数可以为 null,在这种情况下,默认的 Frame 用作父级,并且对话框将居中位于屏幕上.

  • 相关阅读:
    python(内置高阶函数)
    cms 环境搭建
    cookie、session 和 token 区别
    接口用例设计
    python(字符编码与转码)
    从北斗卫星时钟(北斗校时器)发展纵论世界卫星导航新格局
    北斗授时系统(GPS授时设备)错一秒会怎样?京准电子科技
    北斗校时服务器(GPS时钟服务器)在电力调度系统应用
    GPS卫星时钟(北斗授时设备)在监狱管理系统方案
    NTP校时(网络对时服务器)IPC网络摄像机时钟同步
  • 原文地址:https://www.cnblogs.com/llzzy/p/3242989.html
Copyright © 2011-2022 走看看