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 BeanTableModel column order problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
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: 580
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: 1966
    
    7

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


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

Joined: Aug 02, 2012
Posts: 580
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: 1966
    
    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: 2091
    
    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: 150
- 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
 
Don't get me started about those stupid light bulbs.
 
subject: BeanTableModel column order problem
 
Similar Threads
Same query, different results
Testing Strategy
NULLIF problem
How to get the last purchased product?
How do I call removeColumn by name?