Here is the JFrame
that I put my username in
JButton submit_btn = new JButton("Submit");
submit_btn.setBackground(Color.LIGHT_GRAY);
submit_btn.setFont(new Font("Tahoma", Font.BOLD, 15));
submit_btn.setForeground(Color.BLACK);
submit_btn.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
String username = user_textfield.getText();
String password = password_textfield.getText();
try {
App_body app = new App_body();
app.setVisible(true);
app.setData(username);
DesktopApp frame = new DesktopApp();
app.setData(username);
dispose(); ....
}
and here is the JFrame
that I want to get the data from
private String data;
void setData(String data1) {
data = data1;
}
I want to use the information submitted in the first JFrame
in the second one but I don't know how to
get them.