I have a problem that I really don't know how to add multiple lines to a Label in JavaFX.
For instance:
Label label = new Label();
for(int i= 0; i<10; i++){
label.setText(Integer.toString(i));
}
So, when the loop ends, the label only shows the final value, which is 9.
So, any solutions that can display all the numbers 1-9 with break lines (such as '\ n') between them.
This problem arises when I want to show Bill of my project, which contains many dishes. Thank you for your help.
source
share