/* * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. */ import javafx.application.Application; import javafx.event.EventHandler; import javafx.geometry.VPos; import javafx.scene.Group; import javafx.scene.Scene; import javafx.scene.input.KeyCode; import javafx.scene.input.KeyEvent; import javafx.scene.text.Text; import javafx.stage.Stage; /** * * @author Alexander Kouznetsov */ public class Bug extends Application { public static void main(String[] args) { // System.setProperty("prism.dirtyopts", "false"); launch(args); } @Override public void start(final Stage stage) throws Exception { final Text text = new Text(); text.setTextOrigin(VPos.TOP); Scene scene = new Scene(new Group(text), 500, 50); stage.setScene(scene); stage.show(); scene.setOnKeyPressed(new EventHandler() { public void handle(KeyEvent t) { if (t.getCode() == KeyCode.CONTROL) { text.setText(text.getText() + "c"); t.consume(); } } }); } }