This discussion is archived
1 Reply Latest reply: Aug 24, 2011 6:30 AM by 883616 RSS

javafx 1.3 with swinglabel displaying html formated texts

883616 Newbie
Currently Being Moderated
Dear FX experts,

I am using swinglabel to display html formated text, and it worked fine with the fx 1.2. However, as I moved to 1.3, the showing of the text is not so proper, because I want the content of the swinglabel be shown in the middle of the box(the label itself) I set. However, in 1.2 it's ok, but 1.3 gives me headache: it's not shown on the place it should be, like it's ignoring all the centering attribute I tried to declare...

any ideas? or suggestions? or solution?
(ps, it keeps saying a warning if I used the class under ext package, since swingLabel is under ext... maybe it means I can use another class to do this? but I can't find any...)

my codes would be like the followings:
public def contentLabel: SwingLabel = SwingLabel {
text: "<html\><font size=6>test test</font></html>"
width: 400
height: 500
horizontalAlignment: SwingHorizontalAlignment.CENTER

public function run(){

Stage {
    scene: Scene {
         width: 800
         height: 600
         content: [contentLabel]

Edited by: 880613 on 20.08.2011 16:41

Edited by: 880613 on 21.08.2011 05:13


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