• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

BeanTableModel column order problem

 
Ranch Hand
Posts: 634
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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



column-order.jpg
[Thumbnail for column-order.jpg]
 
Bartender
Posts: 3648
16
Android Mac OS X Firefox Browser Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How is the BeanTableModel source look like? In it did you override the getColumnName() method?
 
Jacky Luk
Ranch Hand
Posts: 634
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 3648
16
Android Mac OS X Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Rancher
Posts: 3324
32
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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: https://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.
 
Ranch Hand
Posts: 174
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
- 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
reply
    Bookmark Topic Watch Topic
  • New Topic