在FXML中使用自定义Swing类

时间:2022-11-18 17:01:43

Following a former * suggestion, I extended the DefaultStyledDocument Swing class in order to support custom text with syntax hilight. Is there a way to make FXML support my class extending DefaultStyledDocument? Or better, does JavaFX has a component equivalent to DefaultStyledDocument?

按照以前的*建议,我扩展了DefaultStyledDocument Swing类,以支持语法hilight的自定义文本。有没有办法让FXML支持我的类扩展DefaultStyledDocument?或者更好的是,JavaFX是否有一个与DefaultStyledDocument等效的组件?

1 个解决方案

#1


2  

you could use a SwingNode to embed your swing classes in a javafx application. Details about how to use this class can be found in an oracle tutorial here.

你可以使用SwingNode将你的swing类嵌入到javafx应用程序中。有关如何使用此类的详细信息,请参阅此处的oracle教程。

#1


2  

you could use a SwingNode to embed your swing classes in a javafx application. Details about how to use this class can be found in an oracle tutorial here.

你可以使用SwingNode将你的swing类嵌入到javafx应用程序中。有关如何使用此类的详细信息,请参阅此处的oracle教程。