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