Question

I am using a BorderLayout, 3 Containers with GridLayout and an array of 8 JLabels. The Container #1 uses 2 JLabels, the Container #2 uses 2 JLabels and the Container #3 uses 2 JLabels as well. I include Container #1 North, works fine. The Container #2 Center, works fine, the Container #3 South, works fine too. But when I come to include 1 JLabel of the array East and 1 JLabel West they don't show up, I don't know why and I've spend hours searching for it. Pretty much:

add("North", con1);
add("Center", con2);
add("South", con3);
add("East", myarray[6]);
add("West", myarray[7]); 

What am I doing wrong? D: Thanks a lot

Was it helpful?

Solution

You have to add the JLabels to own Panels, then add the Panels to your BorderLayout.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top