0

Pls help with my java project using GUI Swing.

Hi, i am relatively new to programming using Swing, in my code the textfield array for the number of players does not appear visible. i can't figure out what is wrong. It is created though as the System prints out the length of the textfield for each one to check. It is not being added to the GridBagLayout. https://code.sololearn.com/cpqSP34IeRdK

19th Apr 2020, 5:24 PM
Stephen
3 Respostas
+ 1
Hello Stephen Line 33: If you change this: playerNumberLabel.setVisible (true); you will see that your Label is there but it ended up somewhere in the middle of nowhere ;) I suggest you to set the x and y postion.
19th Apr 2020, 9:49 PM
Denise Roßberg
Denise Roßberg - avatar
0
hi playerNumberLabel is made visible when the startButton is click. But the playerName and playerNameLabel does not show.
20th Apr 2020, 2:44 PM
Stephen
0
Stephen And I think that's because they're not positioned correctly. Once you make them visible, you can check where they are and adjust their position. If everything is correct, you can make it invisible again.
20th Apr 2020, 3:41 PM
Denise Roßberg
Denise Roßberg - avatar