Reputation: 11
I want a joptionpane with a textbox and a button and when click on the button perform my own functions
Upvotes: 1
Views: 4924
Reputation: 240860
/*
* 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 :
Upvotes: 5
Reputation: 13728
Maybe you just want a modal JDialog with a JLabel or a JTextArea and a JButton.
Upvotes: 0