File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes XML backed JTable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "XML backed JTable" Watch "XML backed JTable" New topic
Author

XML backed JTable

Charles Burton
Ranch Hand

Joined: Jan 31, 2011
Posts: 39

So, before I describe what I'm trying to do I'll give my standard disclaimer. I'm coding to java 1.4 and will not be upgrading for a while. All code posted is handjammed in from a system that is airgapped and may have typos and not be as complete as I would like to make it.

Now, on to what I'm trying to do. I'm trying to make a JTable where one row is backed by a org.w3c.dom.Node. I want to be able to parse that node's attributes/values into the cells for editing. The editing will be done by different component types including JComboBoxes, JTextFields, and JCheckBoxes. Editing changes will be made using these components and reflected in the Node's attributes/values. Let me show you what I have so far.




Sample XML Node

Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18570
    
    8

You don't update the backing store based on what happens in the cell editor. You should update it based on what happens in the setValueAt() method of the table model.
Charles Burton
Ranch Hand

Joined: Jan 31, 2011
Posts: 39

Paul Clapham wrote:You don't update the backing store based on what happens in the cell editor. You should update it based on what happens in the setValueAt() method of the table model.


Thanks, that got me on the right track. I'll post some code once I figure it all out.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: XML backed JTable