This discussion is archived
3 Replies Latest reply: Jan 9, 2013 9:39 AM by James_D RSS

Adusting titledpane's width with the column's width

964914 Newbie
Currently Being Moderated
I need to show a titledpane inside a table view's column. I wrote a custom cell factory class to do it. Now I need to set the width of titledpane to match the width of the table column. When the column is resized, then titled pane should also be resized. How to bind this. I tried with prefWidth but when the table column is resized, then the titled pane isn't resized. Kindly let me know.
        TitledPane tp = new TitledPane();
        tp.setText("");
        tp.setAnimated(true);
        tp.setCollapsible(false);
        tp.setContent(new Label("This is a text but actually this needs to be replaced with a VBOX"));
        
        tp.setPrefWidth(getTableColumn().getPrefWidth());

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points