This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Background: I have a parent window (JFrame object) CustomerForm and a child window (JFrame object) InsertForm. InsertForm is displayed when insert button on CustomerForm is clicked.
Question: 1. When InsertForm is displayed, how can I make CustomerForm not accessible? Previously I use setFocusableWindowState( false ) but that only makes CustomerForm stays behind InsertForm; the buttons on CustomerForm are still clickable.
2. How do I pass info on InsertForm to CustomerForm? I have text fields of Name, Address, etc. Do I just use getText() and pass the values to CustomerForm's variable?
>1. When InsertForm is displayed, how can I make CustomerForm not accessible?
when InsertForm is created, next line = CustomerForm.setVisible(false); in the constructor of InsertForm, have
2. How do I pass info on InsertForm to CustomerForm? either make InsertForm an inner class (exposing the variables to InsertForm) or pass a reference to CustomerForm when InsertForm is created
then, in the window closing event you add the code to update CustomerForm data
Joined: Oct 22, 2004
Regarding your solution #1 The CustomerForm, then, will be hidden. I just want to deactive it. User still sees it but can't bring it on top or press any buttons on it I come up with this one. Let me know if this sufficient.
Thanks a bunch for the previous reply. Solution #2 works great. [ October 22, 2004: Message edited by: Lang Miao ]