|
|
Cut/Copy/Paste Don't Work for Tables?
I implemented cut/copy/paste for components in a JTree. I usedTransferable and TransferHandler (works very nicely, BTW). But, I'mhaving a problem.I can cut/copy/paste any item in the tree - it works as it should.When I open a view to the items in the tree (a property editor window)and attempt to cut/copy/paste, it works as it should (closes thewindow on cut and the paste works correctly) EXCEPT for one item inthe JTree.The item I can't copy and paste is exactly like the other items(inherits from the same base classes, etc.) except for the fact thatit has a class veriable of type DefaultTableModel. When I remove thereference to that variable, cut/copy/paste of this component worksfine.Any idea why? I can't get any errors/exceptions and my trace endssomewhere within the Java code (but I can't see the code to see what'shappening). I thought it might have something to do withSerializable, but DefaultTableModel is Serializable.Thanks for any help.
|
|
0
|
|
|
|
Reply
|
jason.cavett (211)
|
3/21/2007 8:25:54 PM |
|
On Mar 21, 4:25 pm, "Jason Cavett" <jason.cav...@gmail.com> wrote:> I implemented cut/copy/paste for components in a JTree. I used> Transferable and TransferHandler (works very nicely, BTW). But, I'm> having a problem.>> I can cut/copy/paste any item in the tree - it works as it should.> When I open a view to the items in the tree (a property editor window)> and attempt to cut/copy/paste, it works as it should (closes the> window on cut and the paste works correctly) EXCEPT for one item in> the JTree.>> The item I can't copy and paste is exactly like the other items> (inherits from the same base classes, etc.) except for the fact that> it has a class veriable of type DefaultTableModel. When I remove the> reference to that variable, cut/copy/paste of this component works> fine.>> Any idea why? I can't get any errors/exceptions and my trace ends> somewhere within the Java code (but I can't see the code to see what's> happening). I thought it might have something to do with> Serializable, but DefaultTableModel is Serializable.>> Thanks for any help.After a little more research, I have discovered that my problem isthis line..."productTable.setModel(production.getProducts());"getProducts() returns a ProductTableModel which extendsDefaultTableModel. If I remove this line, I am then able to cut/copy/paste the component.Two weird things.1. This line occurs in the creation of my view for the productionobject.2. If the view is open, the problem occurs. If the view is closed theproblem doesn't. Either way, the object that I am copying/pasting(production) still has an object of type ProductTableModel.I am *really* confused.
|
|
0
|
|
|
|
Reply
|
Jason
|
3/21/2007 8:41:21 PM
|
|
|
1 Replies
499 Views
(page loaded in 0.008 seconds)
Similiar Articles: Cut/Copy/Paste Don't Work for Tables? - comp.lang.java.programmer ...I implemented cut/copy/paste for components in a JTree. I usedTransferable and TransferHandler (works very nicely, BTW). But, I'mhaving a problem.I ... Using native cut copy paste in JTable - comp.lang.java.gui ...Cut/Copy/Paste Don't Work for Tables? - comp.lang.java.programmer ... Using native cut copy paste in JTable - comp.lang.java.gui ... Cut/Copy/Paste Don't Work for Tables ... how to create 'copy' & 'paste' menu? - comp.soft-sys.matlab ...Cut/Copy/Paste Don't Work for Tables? - comp.lang.java.programmer ... how to create 'copy' & 'paste' menu? - comp.soft-sys.matlab ... copy of a table out of a pdf file ... New version of the Tcl/Tk GUI builder PureTkGUI : v0.10.0 - comp ...Cut/Copy/Paste Don't Work for Tables? - comp.lang.java.programmer ... New version of the Tcl/Tk GUI builder PureTkGUI : v0.10.0 - comp ... This release brings you an ... Swing Copy Problem - comp.lang.java.guiUsing native cut copy paste in JTable - comp.lang.java.gui ... Swing Copy Problem - comp.lang.java.gui Cut/Copy/Paste Don't Work for Tables? - comp.lang.java ... Mysterious java error - comp.soft-sys.matlabCut/Copy/Paste Don't Work for Tables? - comp.lang.java.programmer ... Mysterious java error - comp.soft-sys.matlab Mysterious java error - comp.soft-sys.matlab | Computer ... How to run Notepad and Paste from clipboard to it - comp.lang ...> > Sudip Hi Sudip, If you don=B4t have to use NOTEPAD, it will work with WinWord. ... Using native cut copy paste in JTable - comp.lang.java.gui ... How to ... unicode display of common characters - comp.emacs... say your copy-and-paste technique doesn't work ... If you don't use the Emacs clipboard handler, you should not be getting UCNs. Unless you use cut-and-paste ... lookup table ... Right Click in runtime - comp.databases.ms-accessCut/Copy/Paste Don't Work for Tables? - comp.lang.java.programmer ... Right Click in runtime - comp.databases.ms-access... Command Cut RunCommand Cut Copy RunCommand Copy ... Running SAS on Ubuntu via wine - comp.soft-sys.sas;) For example, cut, copy, paste are easier with the keyboard ... Hat (ie Fedora) and SUSE (ie open suse) but don't ... The only thing that didn't work was the advanced ... Cut/Copy/Paste Don't Work for Tables? - comp.lang.java.programmer ...I implemented cut/copy/paste for components in a JTree. I usedTransferable and TransferHandler (works very nicely, BTW). But, I'mhaving a problem.I ... copy and paste not working in office - CNET Office & productivity ...Then copy and paste is surely working in office, I would say. All you tell: cut from Access doesn't work. You don't even tell if you copy/cut from a table, from a query ... 7/24/2012 4:08:05 AM
|
|
|
|
|
|
|
|
|