MainApp.java 文件源码

java
阅读 46 收藏 0 点赞 0 评论 0

项目:zest-writer 作者:
private void loadCombinason() {
    scene.addEventFilter(KeyEvent.KEY_PRESSED, t -> {
        String codeStr = t.getCode().toString();
        if(!key.toString().endsWith("_"+codeStr)){
             key.append("_").append(codeStr);
        }
    });
    scene.addEventFilter(KeyEvent.KEY_RELEASED, t -> {
        if(key.length()>0) {
            if("_CONTROL_C_L_E_M".equals(key.toString())){
             // Create the custom dialog.
                Dialog<Void> dialog = new Dialog<>();
                dialog.setTitle(Configuration.getBundle().getString("ui.menu.easteregg"));
                dialog.setHeaderText(null);
                dialog.setContentText(null);
                dialog.setGraphic(new ImageView(this.getClass().getResource("images/goal.gif").toString()));
                dialog.getDialogPane().getButtonTypes().addAll(ButtonType.OK);
                dialog.showAndWait();
            }
            key = new StringBuilder();
        }
    });
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号