开发者

a joptionpane with a textbox and a button

开发者 https://www.devze.com 2023-02-02 06:37 出处:网络
I want a joptionpane with a textbox and a button and when click on the button perform my own fun开发者_如何学Pythonctions/*

I want a joptionpane with a textbox and a button and when click on the button perform my own fun开发者_如何学Pythonctions


/*
 * 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);
    }
}

Output :

a joptionpane with a textbox and a button


Maybe you just want a modal JDialog with a JLabel or a JTextArea and a JButton.

0

精彩评论

暂无评论...
验证码 换一张
取 消