0

I imported a String ArrayList from a file and I tried to write the first string (position 0) of the array in a JTextField. The word is not on the text field, instead of it, I have the word <dynamic> written there.

Here's the code:

txtTEST = new JTextField();
String title =gl.getGL().getBooks().get(0).getTitle();
System.out.println(title);
txtTESTE.setText(title);
Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
eyelash
  • 112
  • 1
  • 1
  • 11

1 Answers1

1

< dynamic > means that this text field has not a static string (e.g "Hello world"). Window builder will show it, when the value of the field is a variable.

gl.getGL().getBooks().get(0).getTitle();

This is a variable, hence the window builder will show < dynamic >.

As far as i remember though (i have not used windowbuiler for almost a year), if you give a final variable to the field, window builder will be a able to spot it and show the correct value. Something like

private static final String HELLO_WORLD = "Hello world!";
...
textField.setText(HELLO_WORLD);
George Z.
  • 6,643
  • 4
  • 27
  • 47