This week's book giveaway is in the Java 9 forum.
We're giving away four copies of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications and have Sander Mak & Paul Bakker on-line!
See this thread for details.
Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Whats a good way of resizing a String so it fits the Scene?  RSS feed

 
Bernard Rosseel
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a txt-file which contains a very long String,which is put into a Label. This label's width exceeds the width property of the Scene and Stage on which it is mounted however.
So a scrolling bar appears at the bottom of the Stage so I can see the end of the String.
This is quite unhandy ofcourse and it would be better if all the text is automatically constrained to the size of the Scene/Stage.

Ive looked intothe official documentation but without much succes.
 
Bernard Rosseel
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I found a partly solution.
nodeObject.setWrapText(true);

This made it wrap stuff up but just not enough. It still is bigger than the Stage.

 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!