Chris Miles wrote:Pete,
Thanks
You're welcome.
I am now using.
Thank you, It now honours the X and Y values as expected, however, it does not seem to honour the widths in the grid layout.
It is honoring the width of the jcomponent.
I do
and
I would expect it to add a red rectangle into the first column, and then a blue rectangle into the second column.
However it is just adding 1 red rectangle taking up the full width of the frame, and then a blue underneath taking up the full width of the frame.
Please see the changes to my post above as I created and posted an
SSCCE, a small compilable program that demonstrates my solution.
You should create one that demonstrates your problem. The link on this is here:
SSCCE
edit: By the way, it is adding a rd rectangle in the first column and a blue
to the right. Your grid layout is set up to create 10 rows and 2 columns, and the red panel is being placed in the left column, the blue in the right. Methinks you may want to read up a little more on GridLayout.