-
Bug
-
Resolution: Fixed
-
P2
-
fx2.1
-
MacOS, b20
Graphics environment is still forced to be headless under Mac.
Sample (just to illustrate problem):
import java.awt.BorderLayout;
import java.awt.Dimension;
import javax.swing.JFrame;
import javax.swing.SwingUtilities;
import com.sun.javafx.application.PlatformImpl;
import javafx.scene.Scene;
import javafx.embed.swing.JFXPanel;
import javafx.scene.control.Button;
import javafx.scene.layout.VBox;
public class Main {
private JFXPanel javafxPanel;
private Scene scene;
public Main() {
JFrame frame = new JFrame("Swing interop");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
javafxPanel = new JFXPanel();
javafxPanel.setPreferredSize(new Dimension(550, 400));
frame.getContentPane().add(javafxPanel, BorderLayout.CENTER);
createScene();
frame.pack();
frame.setLocationRelativeTo(null);
frame.setVisible(true);
}
private void createScene() {
PlatformImpl.startup(new Runnable() {
public void run() {
VBox root = new VBox();
scene = new Scene(root);
root.getChildren().add(new Button("FXButton"));
javafxPanel.setScene(scene);
}
});
}
public static void main(String[] args) {
Button btn = new Button("");
SwingUtilities.invokeLater(new Runnable() {
public void run() {
new Main();
}
});
}
}
Sample (just to illustrate problem):
import java.awt.BorderLayout;
import java.awt.Dimension;
import javax.swing.JFrame;
import javax.swing.SwingUtilities;
import com.sun.javafx.application.PlatformImpl;
import javafx.scene.Scene;
import javafx.embed.swing.JFXPanel;
import javafx.scene.control.Button;
import javafx.scene.layout.VBox;
public class Main {
private JFXPanel javafxPanel;
private Scene scene;
public Main() {
JFrame frame = new JFrame("Swing interop");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
javafxPanel = new JFXPanel();
javafxPanel.setPreferredSize(new Dimension(550, 400));
frame.getContentPane().add(javafxPanel, BorderLayout.CENTER);
createScene();
frame.pack();
frame.setLocationRelativeTo(null);
frame.setVisible(true);
}
private void createScene() {
PlatformImpl.startup(new Runnable() {
public void run() {
VBox root = new VBox();
scene = new Scene(root);
root.getChildren().add(new Button("FXButton"));
javafxPanel.setScene(scene);
}
});
}
public static void main(String[] args) {
Button btn = new Button("");
SwingUtilities.invokeLater(new Runnable() {
public void run() {
new Main();
}
});
}
}
- blocks
-
JDK-8101369 Printing
-
- Closed
-
- duplicates
-
JDK-8125442 Mac: Only in JavaFX is Desktop not supported
-
- Closed
-
- is blocked by
-
JDK-8097812 Switch FX8 production builds to use JDK 8
-
- Closed
-
- relates to
-
JDK-8093315 Gtk: eliminate the need for using javafx.macosx.embedded
-
- Closed
-
-
JDK-8120656 NPE in glass using J2DPipeline
-
- Resolved
-