a joptionpane with a textbox and a button
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 :
Maybe you just want a modal JDialog with a JLabel or a JTextArea and a JButton.
精彩评论