6

Is it possible to add a bullet point to the start of a JavaFX label?

Here is basic FXML for a label

<Label fx:id="lblTerm1" text="Label" wrapText="true" VBox.vgrow="ALWAYS" />

It outputs something like this

My Name

I would like something like

  • My Name
Gillardo
  • 9,518
  • 18
  • 73
  • 141

1 Answers1

5

You can include a bullet in the text being displayed on the label using unicode character.

0x2022  8226    BULLET  •

If you are looking for something larger, you can look into this: What would be the Unicode character for big bullet in the middle of the character?

Hope this helps.

Community
  • 1
  • 1
Tanmay Patil
  • 6,882
  • 2
  • 25
  • 45
  • 1
    And is there anyway of putting this in the text of the label from FXML? I have tried setting the text to \u2022, which works fine if i do it in code, but not via FXML file – Gillardo Feb 11 '15 at 16:00
  • 6
    Use a character entity: `` – James_D Feb 11 '15 at 16:50