import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
class Nmain extends JDialog {
private JTextField tf = new JTextField(12);
private JButton ob = new JButton("Next");
public Nmain(JFrame frame, String title) {
super(frame, title, true);
ob.setForeground(Color.blue);
setLayout(new FlowLayout());
add(tf);
add(ob);
setSize(200, 100);
ob.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
setVisible(false);
}
});
}
public String getInput() {
if(tf.getText().length() == 0) return null;
else return tf.getText();
}
}
public class Main extends JFrame{
private Nmain dlog;
public static void main(String[] args) {
new Main();
}
}



