aspose file tools*
The moose likes JavaFX and the fly likes How to set size of column equal to size of column's header in TableView? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JavaFX
Bookmark "How to set size of column equal to size of column Watch "How to set size of column equal to size of column New topic
Author

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

Volodymyr Levytskyi
Ranch Hand

Joined: Mar 29, 2012
Posts: 505
    
    1

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?


True person is moral, false is right!
Ranganathan Kaliyur Mannar
Bartender

Joined: Oct 16, 2003
Posts: 1083
    
  10

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.


Ranga.
SCJP 1.4, OCMJEA/SCEA 5.0.
Volodymyr Levytskyi
Ranch Hand

Joined: Mar 29, 2012
Posts: 505
    
    1

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

Joined: Oct 16, 2003
Posts: 1083
    
  10

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?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to set size of column equal to size of column's header in TableView?