I'm having a problem attempting to create a basic form/dialog. I've read about the built-in dialogs, however I would like a dialog that allows a person to input a bunch of information (username, password, port number, etc). To do this I assume you have to use a JDialog, however I'm having problems finding examples of passing the information back.
I've created a modal JDialog that uses a separate class as the Content Pane (text fields and ok button), but how do I get the data back to the original class/frame that calls the JDialog. This may be easy, but I'm pretty new to Java and can't find documentation/examples of this. Maybe I'm doing it completely wrong. Below is the function I created, which may help. I want the JLabel's in my LoginPanel class passed back to this function, then returned by the function:
private void Login(){
logginDialog = new JDialog(this, true);
logginDialog.setResizable(false);
logginDialog.setSize(450,250);
logginDialog.getContentPane().add(new LoginPanel());
logginDialog.show();
}
Any help would be appreciated.
I've created a modal JDialog that uses a separate class as the Content Pane (text fields and ok button), but how do I get the data back to the original class/frame that calls the JDialog. This may be easy, but I'm pretty new to Java and can't find documentation/examples of this. Maybe I'm doing it completely wrong. Below is the function I created, which may help. I want the JLabel's in my LoginPanel class passed back to this function, then returned by the function:
private void Login(){
logginDialog = new JDialog(this, true);
logginDialog.setResizable(false);
logginDialog.setSize(450,250);
logginDialog.getContentPane().add(new LoginPanel());
logginDialog.show();
}
Any help would be appreciated.