• 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

How to set size of column equal to size of column's header in TableView?

 
Ranch Hand
Posts: 514
1
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello!

I use TableView in javaFX8. I need two things:
1. Disable auto_resizing of columns. I want TableView not to resize when its parent resizes. But columns still should be resized.
2. Set column's width to be equal to width of column's header. How to access column header in TableColumn?
 
Bartender
Posts: 1104
10
Netbeans IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am unable to understand your questions clearly, but, will try...

Volodymyr Levytskyi wrote:1. Disable auto_resizing of columns. I want TableView not to resize when its parent resizes. But columns still should be resized.


Check this link

Volodymyr Levytskyi wrote:2. Set column's width to be equal to width of column's header. How to access column header in TableColumn?


Am unable to understand the first part of the question. For the second part, the graphic property contains the header.
 
Bin Smith
Ranch Hand
Posts: 514
1
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you very much for reply!

I meant that column's width should be equal to column's header width or to the widest cell's width.

How to get width of header and use it as width of column?
 
Ranganathan Kaliyur Mannar
Bartender
Posts: 1104
10
Netbeans IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry for my late reply. I still don't get the question - I mean, by default, the width of a column is same as the width of the column - isn't it?

So, why is it different here. I think you should give more details on this...how about the image of current output?
 
reply
    Bookmark Topic Watch Topic
  • New Topic