Forum Stats

  • 3,853,806 Users
  • 2,264,277 Discussions
  • 7,905,450 Comments

Discussions

Image in table column header to the right of the text?

qwerty1
qwerty1 Member Posts: 17
edited Jan 3, 2013 12:33PM in JavaFX 2.0 and Later
Does anyone know how I can put an image on the right of the text in the table column header?

If I do column.setGraphic it positions image on the left, how can I change the position of the image?
For that matter how can I set alignment of the image? Like if I want it in the corner (even left corner will do) and not next to the text?

Appreciate any help !

Answers

  • James_D
    James_D Member Posts: 1,496 Gold Trophy
    You can do this with CSS (needs an external stylesheet, can't be done (easily) with an inline style).

    Something like
    .table-view .column-header-background .label {
      -fx-content-display: right ;
    }
    (Untested... you may need to experiment a bit.)

    The structure of the table view control from the css perspective is documented here: http://docs.oracle.com/javafx/2/api/javafx/scene/doc-files/cssref.html#tableview
  • qwerty1
    qwerty1 Member Posts: 17
    Works nicely ! Thanks a lot, James !
This discussion has been closed.