带有文本框和按钮的 joptionpane

1 java swing joptionpane

我想要一个带有文本框和按钮的 joptionpane,当单击按钮时执行我自己的功能

Jig*_*shi 5

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.life.java.so.questions;

import javax.swing.JOptionPane;

/**
 *
 * @author Jigar
 */
public class InputDialog {
    public static void main(String[] args) {
        String input = JOptionPane.showInputDialog("Enter Input:");
        System.out.println(input);
    }
}
Run Code Online (Sandbox Code Playgroud)

输出 :

替代文字