package controlskintest; import javafx.application.Application; import javafx.scene.Group; import javafx.scene.Node; import javafx.scene.Scene; import javafx.scene.control.Control; import javafx.scene.control.Skin; import javafx.scene.control.Skinnable; import javafx.scene.paint.Color; import javafx.scene.shape.Circle; import javafx.scene.shape.Line; import javafx.scene.transform.Transform; import javafx.stage.Stage; public class ControlSkinTest extends Application { public class TestControl extends Control { public TestControl() { this.setSkin(new testSkin()); } public class testSkin implements Skin { private Line skinNode = new Line(0,0,1,0); public testSkin() { } @Override public Skinnable getSkinnable() { return TestControl.this; } @Override public Node getNode() { return skinNode; } @Override public void dispose() { } } } @Override public void start(Stage primaryStage) { primaryStage.setTitle("ControlSkinTest"); Group root = new Group(); Scene scene = new Scene(root, 1000, 1000, Color.LIGHTGREEN); root.getChildren().add(new Circle(0,0,2,Color.RED)); Line tstline = new Line(0,0,2,0); tstline.setStroke(Color.RED); TestControl tstcntrl = new TestControl(); tstline.getTransforms().add(Transform.affine(200,200,-200,200,0,0)); root.getChildren().add(tstline); tstcntrl.getTransforms().add(Transform.affine(200,200,-200,200,0,0)); root.getChildren().add(tstcntrl); root.setTranslateX(200); root.setTranslateY(200); primaryStage.setScene(scene); primaryStage.show(); } public static void main(String[] args) { launch(args); } }