i have 2 jpanel(panel1 and panel2),and i want send a input string from panel1 to 2, but how?In few words In panel2 there will be buttons (yes or no) and at the press i want to send the response response="Yes"||"No"
to panel1.I've try to create an object of panel2 but when i send the variable,response is null.Can you explain me using java swing?
Asked
Active
Viewed 20 times
0

fenigo69
- 53
- 1
- 8
-
There lots of ways you can do this, typically though, you need a reference to the object you want to talk to – MadProgrammer Nov 09 '15 at 00:53
-
i do a object, but when i go to control the content of variable, response is null.can you write me some example? – fenigo69 Nov 09 '15 at 03:39
-
You can? Next time, consider providing a [runnable example](https://stackoverflow.com/help/mcve) which demonstrates your problem. This is not a code dump, but an example of what you are doing which highlights the problem you are having. This will result in less confusion and better responses – MadProgrammer Nov 09 '15 at 03:40
-
sorry,simply i do what i wrote first – fenigo69 Nov 09 '15 at 03:49