• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Volodymyr Lysenko
Ranch Hand
Posts: 512
1
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • 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?
 
Ranganathan Kaliyur Mannar
Bartender
Posts: 1103
10
Java Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • 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.
 
Volodymyr Lysenko
Ranch Hand
Posts: 512
1
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • 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: 1103
10
Java Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • 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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic