Can we have TableSkinUtils.resizeColumnToFitContent as public API

Robert Lichtenberger r.lichtenberger at gmail.com
Mon Jun 24 12:26:26 UTC 2019


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