Click here to Skip to main content
15,881,089 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Morning guys
I have a question
I would like to know how to pass values between frames.
here is the scenario. I select a row on a jtable. when i click on a button, i want to pop up those values in a textfields of another frame
thanks
Posted

1 solution

How about an Actionlistener?

ActionListener[^] @ java Tutorials.

That one can pass a value (figure selected Row of JTable in Listener and pass data as argument to new JFrame)
You can open a second JFrame/JDialog and work there - afterwards return to default JFrame.

Java
// be careful! This would close the complete app.
// this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

// last JFrame standing will terminate the app
this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);


Choose wisely which DefaultCloseOperation you want little Hobbit ;)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900