Libraryless. Click here for Pure Java version (86L/1K/4K).
1 | !759 |
2 | |
3 | import javafx.application.Application; |
4 | import javafx.scene.Group; |
5 | import javafx.scene.Scene; |
6 | import javafx.embed.swing.SwingNode; |
7 | import javafx.scene.layout.StackPane; |
8 | import javafx.stage.Stage; |
9 | |
10 | public class main extends Application { |
11 | p { |
12 | fixContextClassLoader(); |
13 | launch(); |
14 | } |
15 | |
16 | public void start(Stage stage) { |
17 | SwingNode swingNode = new SwingNode(); |
18 | |
19 | createSwingContent(swingNode); |
20 | |
21 | StackPane pane = new StackPane(); |
22 | pane.getChildren().add(swingNode); |
23 | |
24 | stage.setTitle("Swing in JavaFX"); |
25 | stage.setScene(new Scene(pane, 250, 150)); |
26 | stage.show(); |
27 | } |
28 | |
29 | void createSwingContent(final SwingNode swingNode) { |
30 | awt { |
31 | swingNode.setContent(new JButton("Click me!")); |
32 | } |
33 | } |
34 | } |
Began life as a copy of #1003698
download show line numbers debug dex old transpilations
Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
ID | Author/Program | Comment | Date |
---|---|---|---|
1255 | stefan | Works! But has a weird bg color change (black to white) | 2016-07-25 23:42:33 |
Snippet ID: | #1003699 |
Snippet name: | JavaFX + Swing Test |
Eternal ID of this version: | #1003699/1 |
Text MD5: | f1f420690257419dae9a16ae061ac8df |
Transpilation MD5: | 132e0ec4cc7b3005ee09e2c30ab9d1da |
Author: | stefan |
Category: | javax / javafx |
Type: | JavaX source code |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2016-07-25 23:41:34 |
Source code size: | 763 bytes / 34 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 806 / 882 |
Referenced in: | [show references] |