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.
I am building a GUI to lay over a script that I have already written for calculating some chemistry "stuff."
The crucial input is a list of solutes with a few associated parameters. Like so
The whole point of the GUI s to collect this information from the user, run a few calculations and return a formatted text list.
The code as shown has 3 rows (solutes). Users may want to run the script with from 2-8 solutes. I would like some sort of interface that displays the parameters a little more clearly than the form above.
I have been thinking about using a jTable (the rest of the GUI is swing-based) but I can't figure out how to get the contents back from it. Is jTable the way to go? If not, what is? If so, how to I get that user input out?
Yes, JTable would be a good starting point. You get the data from its table model once the user clicks the "OK" button or whatever they do to indicate they have finished inputting the data.
Joined: Nov 11, 2005
Paul Clapham wrote:Yes, JTable would be a good starting point. You get the data from its table model once the user clicks the "OK" button or whatever they do to indicate they have finished inputting the data.
What is the method call for that? I found all the .getComponent methods, and all the methods for getting information about what is currently being edited (row#, col#, etc) but not for the cell contents.