Is there a way to make JSON output in a 2D matrix table?

I’ve been trying and looking at different things, but I’m stumped.
I tried using a 2D matrix of strings and then to print it out on Spring Boot I made a JSONArray which would represent the the 2D matrix and hold the place.

So here comes my issue.

I create this:

JSONObject jObject = new JSONObject("{"Dimensions":"[2,2]"" + matrix + "}");

The output is on a single line:
{“Dimensions”:”[2,2]”[“1″,”2″,”3″,”4”]}

I was wondering if its possible to make it so I could make the JSON print out like a 2 by 2 matrix table so like
[“1”, “2”,
“3”, “4”,]

I know its not proper JSON printout but I was wondering if there were ways to manipulate it? I tried using GSON, Jackson or maybe I used it wrong, not sure. I would love to get some insight if I shouldn’t even be approaching it like this or if there was something I missed!

Thanks!