Java Code Examples for javafx.embed.swing.JFXPanel#setLayout()

The following examples show how to use javafx.embed.swing.JFXPanel#setLayout() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ConstellationDialog.java    From constellation with Apache License 2.0 5 votes vote down vote up
public ConstellationDialog() {
    fxPanel = new JFXPanel();
    final BoxLayout layout = new BoxLayout(fxPanel, BoxLayout.Y_AXIS);
    fxPanel.setLayout(layout);
    fxPanel.setOpaque(false);
    fxPanel.setBackground(TRANSPARENT);
}
 
Example 2
Source File: RadioChooserDialog.java    From pcgen with GNU Lesser General Public License v2.1 5 votes vote down vote up
private void initComponents()
{
	Pane outerPane = new VBox();
	JFXPanel jfxPanel = new JFXPanel();
	jfxPanel.setLayout(new BorderLayout());

	setTitle(LanguageBundle.getString("in_chooserSelectOne")); //$NON-NLS-1$
	setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);

	Node titleLabel = new Text(chooser.getName());
	titleLabel.getStyleClass().add("chooserTitle");
	URL applicationCss = getClass().getResource("/pcgen/gui3/application.css");
	String asString = applicationCss.toExternalForm();
	outerPane.getStylesheets().add(asString);
	outerPane.getChildren().add(titleLabel);
	toggleGroup = new ToggleGroup();

	outerPane.getChildren().add(buildButtonPanel());

	this.getContentPane().setLayout(new GridLayout());
	this.getContentPane().add(jfxPanel, BorderLayout.CENTER);


	ButtonBar buttonBar = new OKCloseButtonBar(
			this::onOK,
			this::onCancel);
	outerPane.getChildren().add(buttonBar);
	Platform.runLater(() -> {
		Scene scene = new Scene(outerPane);
		jfxPanel.setScene(scene);
		SwingUtilities.invokeLater(this::pack);
	});
}
 
Example 3
Source File: RadioChooserDialog.java    From pcgen with GNU Lesser General Public License v2.1 5 votes vote down vote up
private void initComponents()
{
	Pane outerPane = new VBox();
	JFXPanel jfxPanel = new JFXPanel();
	jfxPanel.setLayout(new BorderLayout());

	setTitle(LanguageBundle.getString("in_chooserSelectOne")); //$NON-NLS-1$
	setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);

	Node titleLabel = new Text(chooser.getName());
	titleLabel.getStyleClass().add("chooserTitle");
	URL applicationCss = getClass().getResource("/pcgen/gui3/application.css");
	String asString = applicationCss.toExternalForm();
	outerPane.getStylesheets().add(asString);
	outerPane.getChildren().add(titleLabel);
	toggleGroup = new ToggleGroup();

	outerPane.getChildren().add(buildButtonPanel());

	this.getContentPane().setLayout(new GridLayout());
	this.getContentPane().add(jfxPanel, BorderLayout.CENTER);


	ButtonBar buttonBar = new OKCloseButtonBar(
			this::onOK,
			this::onCancel);
	outerPane.getChildren().add(buttonBar);
	Platform.runLater(() -> {
		Scene scene = new Scene(outerPane);
		jfxPanel.setScene(scene);
		SwingUtilities.invokeLater(this::pack);
	});
}