Wie man eine input-dialogbox, die mehr als ein textfield(ie. kann viele Eingänge)

Implementierte ich eine Eingang - DialogBox, aber das hat ein textfield. Ich brauche eine input-DialogBox die vielen Textfeldern zu Eingaben und speichern Sie jede Zeichenfolge in ein array.

Was ich bisher getan habe:

Wie man eine input-dialogbox, die mehr als ein textfield(ie. kann viele Eingänge)


CODE

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JTextField;

public class second extends JFrame implements ActionListener {

JLabel enterName;
JTextField name;
JButton click;
String storeName;

public second() {

    setLayout(null);
    setSize(300, 250);
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    click = new JButton("Click");
    click.setBounds(100, 190, 60, 30);
    click.addActionListener(this);
    add(click);
}

public void actionPerformed(ActionEvent e) {

    if (e.getSource() == click) {
    String response = JOptionPane.showInputDialog(null,
                "What is your name?",
                "Enter your name",
                JOptionPane.QUESTION_MESSAGE);
    }
    }

    public static void main(String args[]) {

    second s = new second();
    s.setVisible(true);
}
}

Vielen Dank

InformationsquelleAutor Haxed | 2010-07-03
Schreibe einen Kommentar