• Post Reply Bookmark Topic Watch Topic
  • New Topic

when i change the column positions in jtable,how do i get the changed positions when i re login?  RSS feed

 
pramod reddy
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all
i am new to java Swing concept.
i want to create a jtable in which i can change the columns positions.
i wnt to get the same positions when i re login.
how can i save the data in the jtable so that i get the same changed positions
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Pramod,
Welcome to the Ranch.

Since 1.4 Java provides a preference API.
More details here http://java.sun.com/j2se/1.4.2/docs/guide/lang/preferences.html
You can choose to preserve the column sequence as a preference and use it when you display the table the next time. If your system has multiple users, you can even save the preferences per user.
 
Rob Spoor
Sheriff
Posts: 20904
81
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Keep an eye on this thread as well. It's about the same problem. In fact, I suspect the two of you are classmates / colleagues.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!