GeeCON Prague 2014*
The moose likes Swing / AWT / SWT and the fly likes Data Xchange from JDialog to JTable using JButton    Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Data Xchange from JDialog to JTable using JButton    " Watch "Data Xchange from JDialog to JTable using JButton    " New topic
Author

Data Xchange from JDialog to JTable using JButton

Ryan Rosario
Greenhorn

Joined: May 29, 2006
Posts: 1
My head is spinning about how to get this to work. What is really confusing me is the data exchange from the JDialog.

I have a JTable where one of the columns uses a JButton as the cell editor for each cell in that column. That part seems to be no problem. The JButton is labeled "Define Staff..."

When the user clicks on the JButton, a JDialog containing a JList is to appear. If the user clicks cancel, the JDialog is disposed and nothing happens. If the user clicks OK, the selected items are to be returned to the cell in some way and the label of the JButton is to change to "Modify Staff..."

How can I return the list from the JDialog to the "cell" so that when I access the cell using getValueAt() I get the list of values, and not the JButton object?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Data Xchange from JDialog to JTable using JButton