Skip to main content

HTML in JavaFX

3 replies [Last post]
tengimon
Offline
Joined: 2008-06-23
Points: 0

Is it possible to put HTML codes inside JavaFX codes like in Java? maybe in the text attribute of a widget or inside the frame's content attribute.

Thanks

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
alexsch
Offline
Joined: 2007-07-12
Points: 0

Yes it is. For example:

[code]
import javafx.ext.swing.*;

Label {
text: "blue"
}
[/code]

richclient
Offline
Joined: 2008-07-10
Points: 0

Doesn't work.
Copied the above into a file, compiled it using javafxc and ran it using javafx.
Compiles ok, but doesn't show a window.
Can anyone tell me whats missing?
New to JavaFX.

Thanks

shagus
Offline
Joined: 2007-05-10
Points: 0

Hi, try the following.

[code]
import javafx.ext.swing.*;

SwingFrame {content: Label {

text: "blue"

}

visible:true

}

[/code]