Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Swing / AWT / SWT
Search Coderanch
Advance search
Google search
Register / Login
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:
Tim Cooke
Campbell Ritchie
paul wheaton
Jeanne Boyarsky
Ron McLeod
Sheriffs:
Paul Clapham
Devaka Cooray
Saloon Keepers:
Tim Holloway
Carey Brown
Piet Souris
Bartenders:
Forum:
Swing / AWT / SWT
JTable
Jamal Hasanov
Ranch Hand
Posts: 411
posted 19 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi all,
How cn I hide some column in JTable? I want to hide the column that contains ID.
Thanx,
JML
Jamal Hasanov
Ranch Hand
Posts: 411
posted 19 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
I solved that problem.
You need to set that column's (and column header's) max and min width to 0.
int idxCol = 0;// number of column. tbl.getColumnModel().getColumn(idxCol).setMaxWidth(0); tbl.getColumnModel().getColumn(idxCol).setMinWidth(0); tbl.getTableHeader().getColumnModel().getColumn(idxCol).setMaxWidth(0); tbl.getTableHeader().getColumnModel().getColumn(idxCol).setMinWidth(0);
Where tbl is JTable.
JML
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
JTable Column Hiding
JTable
JTable problem
Hiding JTable Columns
JTable Column Hide
More...