aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes BeanTableModel column order problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "BeanTableModel column order problem" Watch "BeanTableModel column order problem" New topic
Author

BeanTableModel column order problem

Jacky Luk
Ranch Hand

Joined: Aug 02, 2012
Posts: 590
Hello,
I tried to write a SSCCE for the BeanTableModel, and I found that it is correct for a simple model like this.


But is in the wrong order in my major program I developed so far.
The bean attributes are in correct order
But I will get this, with netsales going first.









Just scratching my hair...
Thanks
Jack





[Thumbnail for column order.jpg]

K. Tsang
Bartender

Joined: Sep 13, 2007
Posts: 2379
    
    7

How is the BeanTableModel source look like? In it did you override the getColumnName() method?


K. Tsang JavaRanch SCJP5 SCJD/OCM-JD OCPJP7 OCPWCD5
Jacky Luk
Ranch Hand

Joined: Aug 02, 2012
Posts: 590
Hi Tsang,

http://tips4java.wordpress.com/2008/11/27/bean-table-model/

Oh.. do I need to? If so, I didn't override it, where should I do it?
I just did this.... that directly apply the BeanTableModel to the JTable after inserting the List of some classes
into the BeanTableModel.

Any pointers are welcome!

Thanks
K. Tsang
Bartender

Joined: Sep 13, 2007
Posts: 2379
    
    7

OK I see that BeanTableModel isn't part of Java API. So forget about what I said earlier.

You may able to utilize the sorting in BeanTableModel to get the correct order. How the columns are sorted will need to look at docs.
Rob Camick
Ranch Hand

Joined: Jun 13, 2009
Posts: 2176
    
    7
Do you ever pay any attention to what people say???

Do you ever respond to your old questions???

You asked this question in your last posting: http://www.coderanch.com/t/625763/GUI/java/call-removeColumn where you where given an answer.

Quit wasting peoples time by posting all these questions. Spend more time reading the answers you have already been given.

The answer to this question was given to you 4 days ago in the original blog entry if you took to the time to read the blog. You were then given an answer yesterday again explaining that the blog contained all the information you needed.
m Korbel
Ranch Hand

Joined: Jun 19, 2012
Posts: 155
- and JXTable has own model, sorter ...., there can be conflict with, but nobody knows

- can be ignored - one o version has own workaround, connector to Beans, you have to check change log, in older
vesion(s) too, but AFAIK Beans and cottons around is one of refused ways, the same as its parent JSR296
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: BeanTableModel column order problem