Format Text output in JavaFX -


I want to print several lines in front of the user using this code:

  Data () () (Dataobies .getOne ()) ++ database.getscand () + + "++ databases. GETH + +" (Datobebase) - & gt; {TilePaneGetBal () "+ Databases .getLs () +" "+ DatabasesGetLast ());});  

But as you can see, the end result Not very formatted output:

Enter image details here

Is there a way to format columns?

There are several options:

  1. The simplest is to use a monospace font where the width of each symbol, including the space Is similar, the most popular courier is new:

      text.setFont (font.font ("courier new", 14));  
  2. As you are providing data in a table format, you can choose to use TableView instead of text >

    < / Li>
  3. Finally, if you are actually like this font and do not want to use TableView , you can split your line in 4 lines Text in Examples Adjust each text so that the same lines are related to the other lines. E.g.

      text t1 = new text (database.eten ()); T1.setMinWidth (100); // adjust according to actual data text t2 = new text (dataobase.getscind ()); T2.setMinWidth (100); // Adjust according to real data text T3 = new text (dataobase .get ts ()); T3.setMinWidth (300); // adjust according to real data text t4 = new text (databases .getLs ()); T4.setMinWidth (300); // adjust according to actual data text t5 = new text (databases .getLast ()); TilePenGet Kids (). AddAll (T1, T2, T3, T4, T5);  

Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -