0

I am using the class Arrow from this project on github : https://github.com/tesis-dynaware/graph-editor

    public Arrow() {

        line.getStyleClass().add(STYLE_CLASS_LINE);
        head.getStyleClass().add(STYLE_CLASS_HEAD);

      */
    public Arrow() {

        line.getStyleClass().add(STYLE_CLASS_LINE);
        head.getStyleClass().add(STYLE_CLASS_HEAD);
        arrowText.getStyleClass().add(textArrow);  

        Group n=new Group(hb,line,head);

        hb.getChildren().add(t);

    }
}

And I want to create Arrow with editable label. But I don't know how to process. Can you help me please ?

fabian
  • 80,457
  • 12
  • 86
  • 114
  • Just add a `TextField` (or a `Label` that is replaced by a `TextField` when the appropriate user interaction occurs). What exactly is the problem? Also I wonder why the `draw()` method is `public`. This could be done in the setter methods as well (or in [`layout`](https://docs.oracle.com/javase/8/javafx/api/javafx/scene/Parent.html#layout--), if doing this multiple times should be prevented). Also all those properties would be implemented as properties, if this was a class from the javafx API... – fabian Jan 11 '16 at 11:16
  • My Classe Arrow extends a Pane, and when i try to add a TextField or a label to the constructor, i got this error message : "TextField cannot be convert to Node" – user5772710 Jan 11 '16 at 11:36
  • Are you sure you use the correct `TextField` class? You can see the `Node` class in the class hierarchy here: https://docs.oracle.com/javase/8/javafx/api/javafx/scene/control/TextField.html – fabian Jan 11 '16 at 12:25
  • You were right..it works perfectly..thank u fabian – user5772710 Jan 11 '16 at 12:45

0 Answers0