When I run the code below as a card on a non-descript cardLayout, I get something similar to what you see in the attachment.
Instead, I want all of the boxes to be the same size: large enough to hold the number "255", but no larger.
I was tempted to use the setMaximumSize and setMinimumSize, but I heard recently that those operations should be avoided, and that you could get the same functionality using the layoutManager itself. How would I change my code below to set the size of my textboxes without using those methods?
Thanks a ton!
Instead, I want all of the boxes to be the same size: large enough to hold the number "255", but no larger.
I was tempted to use the setMaximumSize and setMinimumSize, but I heard recently that those operations should be avoided, and that you could get the same functionality using the layoutManager itself. How would I change my code below to set the size of my textboxes without using those methods?
Thanks a ton!
cardLayout.png
What I see when I run similar code.