Running the following sample on my MacBook Pro with a Retina Display
package fxsample;
import javax.swing.JButton;
import javax.swing.SwingUtilities;
import javafx.application.Application;
import javafx.embed.swing.SwingNode;
import javafx.scene.Scene;
import javafx.scene.effect.Reflection;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;
public class Blim extends Application {
@Override
public void start(Stage stage) {
final SwingNode swingNode = new SwingNode();
Reflection reflection = new Reflection();
reflection.setFraction(0.3);
reflection.setTopOffset(20);
// SepiaTone s = new SepiaTone();
// swingNode.setEffect(s);
//
// DropShadow d = new DropShadow();
// swingNode.setEffect(d);
createAndSetSwingContent(swingNode);
StackPane pane = new StackPane();
pane.getChildren().add(swingNode);
pane.setEffect(reflection);
stage.setScene(new Scene(pane, 100, 50));
stage.show();
}
private void createAndSetSwingContent(final SwingNode swingNode) {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
swingNode.setContent(new JButton("Click me!"));
}
});
}
public static void main(String[] args) {
launch(args);
}
}
results in a blurry text. It feels as if it renders a normal DPI-Version instead of the HiDPI-Version of the SwingNode. SwingNode renders perfectly if there other effects applied
package fxsample;
import javax.swing.JButton;
import javax.swing.SwingUtilities;
import javafx.application.Application;
import javafx.embed.swing.SwingNode;
import javafx.scene.Scene;
import javafx.scene.effect.Reflection;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;
public class Blim extends Application {
@Override
public void start(Stage stage) {
final SwingNode swingNode = new SwingNode();
Reflection reflection = new Reflection();
reflection.setFraction(0.3);
reflection.setTopOffset(20);
// SepiaTone s = new SepiaTone();
// swingNode.setEffect(s);
//
// DropShadow d = new DropShadow();
// swingNode.setEffect(d);
createAndSetSwingContent(swingNode);
StackPane pane = new StackPane();
pane.getChildren().add(swingNode);
pane.setEffect(reflection);
stage.setScene(new Scene(pane, 100, 50));
stage.show();
}
private void createAndSetSwingContent(final SwingNode swingNode) {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
swingNode.setContent(new JButton("Click me!"));
}
});
}
public static void main(String[] args) {
launch(args);
}
}
results in a blurry text. It feels as if it renders a normal DPI-Version instead of the HiDPI-Version of the SwingNode. SwingNode renders perfectly if there other effects applied