NetBeansからJythonFX

NetBeans 6.7をインストールするとNetBeansからJythonFXできます。
NetBeans IDE for Python EA2 Download
Jython2.7a2をインストールしてあるならTools ->Python PlatformsでPython Platform Managerを出しNewボタンを押して/Users/hshino/jython2.7a2/jythonを選択しPlatformを追加。(各自の環境に合わせてください)
Make DefaultボタンをクリックしてJython2.7a2をデフォルトに設定。

右上のJava PathをクリックしてJava Classpathにjfxrt.jarを追加。

これでJythonJavaFX 2を連携させる事が出来ます。

hellojythonfx.py

#!/usr/bin/env jython
# -*- coding: utf-8 -*-
import sys
from javafx.application import Application
from javafx.scene import Scene
from javafx.scene.effect import DropShadow
from javafx.scene.paint import Color
from javafx.scene.paint import  LinearGradientBuilder
from javafx.scene.text import  Text
from javafx.geometry import Insets
from javafx.scene.layout import HBox
from javafx.scene.paint import Stop


class HelloJythonFX(Application):

       def start(self, stage):
	  hbox = HBox()
          hbox.setPadding(Insets(150))
          text0 = Text("Jython")
	  text0.setStyle('-fx-font-size: 80pt')
	  linearGradient = LinearGradientBuilder.create().endX(0).stops(Stop(0.3, Color.SEAGREEN),Stop(0.5, Color.PALEGREEN), Stop(0.8, Color.GREEN)).build()
          text0.setFill(linearGradient)
          text1 = Text("FX")
          text1.setStyle("-fx-font-size: 80pt")
          linearGradient2 = LinearGradientBuilder.create().endX(0).stops(Stop(0.3, Color.CYAN), Stop(0.7, Color.DODGERBLUE)).build()
          text1.setFill(linearGradient2)
          dropShadow = DropShadow()
          dropShadow.setRadius(25.0)
          dropShadow.setSpread(0.25)
          dropShadow.setColor(Color.DODGERBLUE);
          text1.setEffect(dropShadow);

	  hbox.getChildren().addAll(text0, text1)
          scene = Scene( hbox, 640, 480 )
	  scene.setFill (Color.BLACK)
          stage.setScene(scene)
	  stage.setTitle("JythonFX Hello World")
          stage.show()

if __name__ == '__main__':
        Application.launch(HelloJythonFX().class, sys.argv[1:])