Can we have TableSkinUtils.resizeColumnToFitContent as public API

Dirk Lemmermann dlemmermann at gmail.com
Mon Jun 24 12:28:20 UTC 2019


+1

> On 24 Jun 2019, at 14:26, Robert Lichtenberger <r.lichtenberger at gmail.com> wrote:
> 
> At the moment (JavaFX 12) I hack around the fact that TableSkinUtils is not
> public like this:
>    Class<?> clz =
> Class.forName("javafx.scene.control.skin.TableSkinUtils");
>    Method m = clz.getMethod("resizeColumnToFitContent",
> TableViewSkinBase.class, TableColumnBase.class, int.class);
>    m.setAccessible(true);
>    m.invoke(null, tc.getTableView().getSkin(), tc, -1);
> which of course is very brittle.
> 
> I need this to provide the user with an option to fit all columns to their
> required size.
> 
> Double clicking the header separator will call this method so why not
> provide the functionality programatically too?
> 
> Best regards,
> Robert



More information about the openjfx-discuss mailing list