Java - TextFlow how to add list of strings? One after each other?

76 Views Asked by At

let's say I have this example, how to add it, so that it could be displayed later on with gui inside textflow window? :

List<String> Test1 = ["a", "b", "c", "d"];

List<String> Test2 = ["1", "2", "3", "4"];

Output should be like: ("actual output, each on a new line")

  1. Line = "a1";

  2. Line = "b2";

  3. Line = "c3";

How to do this? Thanks in advance.

1

There are 1 best solutions below

1
Icomar On

Do you mean something like this?

String[] Test1 = {"a", "b", "c", "d"};
String[] Test2 = {"1", "2", "3", "4"};

public void main(String[] args)
{
    for (int i = 0; i < Test1.length; i++)
    {
        System.out.println("Line = \"" + Test1[i] + Test2[i] + "\"");
    }
}