RdeLange
asked on
Problem with JFrames
I made an application. In this application I have an Jframe that shows all customers in a table. When the users double clicks an customer the program opens a new JFrame with the customer details.
My problem is that the first JFrame stays accessible. How to solve????
My problem is that the first JFrame stays accessible. How to solve????
ASKER
Why using a dialog? Isn't a JFrame better? Because the user has to fill in a lots of fields.
you can put whatever components you want on a JDialog.
another thing you might want to try is:
when opening second frame call
parentFrame.disable();
when closing second frame:
parentFrame.enable();
when opening second frame call
parentFrame.disable();
when closing second frame:
parentFrame.enable();
oops, make that:
parentFrame.setEnabled(fal se);
and
parentFrame.setEnabled(tru e);
parentFrame.setEnabled(fal
and
parentFrame.setEnabled(tru
ASKER
Yes, thats seems logic to me. I tried this but I see that my data on the first screen doesn't contain the updated data from the second screen.
How can I update that data?
How can I update that data?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
from your initial form:
CustomerInfoDialog cid = new CustomerInfoDialog(this, "Customer Info", true);
cid.show();
public class CustomerInfoDialog extends JDialog {
public CustomerInfoDialog(Frame owner, String title, boolean modal) {
super(owner, title, modal);
// add your components
}
}
}