1

I have 2 JFrame windows. Frame 1 has a text field and one button. If I press this button, it will appear frame 2 include a list of names. When I press this names, frame 2 has been closed and auto add names to frame 1.

What should I do?

peterh
  • 11,875
  • 18
  • 85
  • 108
Nam Trần
  • 21
  • 1
  • 4
    [*The Use of Multiple JFrames: Good or Bad Practice?*](http://stackoverflow.com/questions/9554636/the-use-of-multiple-jframes-good-or-bad-practice) - Just use `JOptionPane` to create a dialog, then you don't have to communicate between `JFrame` classes. (assuming that's what you're doing. If not, I don't really understand what your question is, what part of adding the name to the textfield do you have problems with?) – Lukas Rotter Aug 16 '16 at 17:15
  • 1
    I am confused by your description. Frame one has only a text field and button. Then you talk about opening a 2nd window to choose a name or names from a list. Then finally you say the selected name(s) are to appear in frame 1. Where should they appear? Does frame 1 ***also*** contain a list? – Andrew Thompson Aug 16 '16 at 17:49
  • What is your question? – zhon Aug 16 '16 at 18:29

0 Answers0