9

JavaFX アプリケーションが MacBook Pro Retina 画面でぼやけて表示されます。アプリをシャープに表示する方法はありますか?ブログ投稿/コメントで、これが現在のケースであることが言及されました: http://fxexperience.com/2012/11/retina-display-macbook-pro/

これは 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>

コード例:

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()
    }
}

結果: 結果のアプリケーション

Java バージョン:1.7.0_21

4

1 に答える 1

5

解説の同じ記事で、Richard Blair は、これは最新の JavaFX バージョンで修正されたと述べています (Java 8 の EAP で利用可能で、ここからダウンロードできます) 。

于 2013-04-17T15:42:26.753 に答える