Make a textfielf javaFX disable but selectable [closed]

0

I have created a textfiel disable in JavaFX, but when I run and load the data it does not let me copy or select anything, apparently disable property disables my text box.

textFiel.setDisable (true);

I tried to change the editable property to true textFiel.setEditable (true);

But it still does not work.

Any idea how I can solve this or that I'm not doing well? Thanks !!

    
asked by Margaret López 14.05.2017 в 00:01
source

1 answer

0

With setDisable () the box is disabled for any subsequent operation. To be able to select the content and copy it, without giving the possibility to edit it, delete the line:

textFiel.setDisable( true );

and use:

textFiel.setEditable( false );

You can check the JavaFx Apis, to know how the methods work: link

    
answered by 14.05.2017 / 12:44
source