9

A JavaFX application appears blurry on the MacBook Pro Retina screen. Is there a way to display the application sharp? In a blog post/comment was mentioned that this is the case currently: http://fxexperience.com/2012/11/retina-display-macbook-pro/

This is the example fxml:

<?xml version="1.0" encoding="UTF-8"?>

<?import javafx.scene.layout.*?>
<?import javafx.scene.control.*?>


<VBox xmlns:fx="http://javafx.com/fxml">
    <MenuBar>
        <Menu text="File">
            <items>
                <MenuItem text="Exit"/>
            </items>
        </Menu>
    </MenuBar>
</VBox>

Example code:

import javafx.application.Application
import javafx.fxml.FXMLLoader
import javafx.scene.Scene
import javafx.scene.layout.VBox
import javafx.scene.paint.Color
import javafx.stage.Stage

object CreateFX extends App {
    override def main(args: Array[String]) = {
      println("CreateFX starting up...")
      Application.launch(classOf[CreateFX], args: _*)
    }
}

class CreateFX extends Application {
    def start(stage: Stage): Unit = {
        println("start "+stage)

        stage.setTitle("CreateFX")

        val root: VBox = FXMLLoader.load(getClass().getResource("MainScreenVBox.fxml"))//new VBox

        val scene = new Scene(root, 800, 600)
        scene.setFill(Color.GREEN)

        stage.setScene(scene)
        stage.show()
    }
}

Outcome: Resulting application

Java Version: 1.7.0_21

Appleshell
  • 7,088
  • 6
  • 47
  • 96

1 Answers1

5

In the same article in the commentary Richard Blair stated that this was fixed in the latest JavaFX version (available in the EAP of Java 8, downloadable here)

zhujik
  • 6,514
  • 2
  • 36
  • 43
  • I see. So this is not yet implemented in Java 7? – Appleshell Apr 17 '13 at 16:46
  • It's unlikely that JavaFX retina support would ever be backported to Java 7. All JavaFX support for Java 7 is currently in maintenance mode and new features (such as Retina support) are delivered for Java 8+. – jewelsea Apr 17 '13 at 18:38
  • 2
    Is it just me or is this the answer to almost any question about JavaFX recently? I wish they'd release Java 8 already! – Craig McMahon Nov 06 '13 at 06:26
  • @CraigMcMahon i'd rather have them backport more of the bugfixes / new features to JavaFX 2.2 :/ – zhujik Nov 06 '13 at 08:46
  • Do we know if a fix for this is available in OpenJFX somewhere? I found recently that an IME bug could be resolved by referencing the OpenJFX sources and creating a custom Skin implementation for the text field control. – Craig McMahon Nov 25 '13 at 06:55