File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes move multiple columns in 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 "move multiple columns in jtable" Watch "move multiple columns in jtable" New topic

move multiple columns in jtable

sarvjeet singh

Joined: Sep 28, 2013
Posts: 1
I have multiple tab and each tab have a table with multiple columns. I move like this for example-
col1 col2 col3 col4 col5 col6 col7 col8 col9

after columns move

col2 col1 col3 col5 col4 col6 col8 col7 col9

I save table and get it, it works fine. But when i move columns like this-

col4 col3 col5 col1 col6 col2 col7 col8 col9

it never work as i save and get table. please tell what's wrong in below code.

here are the codes-

Table save code-

code for get Table-

here is the code for set table change property with popup-
Ranganathan Kaliyur Mannar

Joined: Oct 16, 2003
Posts: 1101

Hi sarvjeet,
Welcome to the Ranch!

One of the best ways to debug a program is to first create a small program with only those parts that seem to create trouble for you. This is called SSCCE (click on the link to understand more).

My suggestion would be to create such a program and try narrowing down the problem. If you are still not able to find it out, it will always be easier to post that code - which volunteers here can simply take and run it directly. It will lead to faster resolutions.

I agree. Here's the link:
subject: move multiple columns in jtable
It's not a secret anymore!