this is my panel, which is on the bottom half of another panel (also mig layout).
The trouble is this panel always end up with the panel title and the table titles are visible but not the actual data.
i would like not to put the table in a scroll pane, but that appears to be how swing is designed to display tables.
I made a panelClass that overrode getSize and getPreferedSize to make a min height, but they were being ignored.
So my question is: how do i either make the panel big enough using the scroll pane, or make the table display properly not using the scroll pane?
or make the table display properly not using the scroll pane
Now that's strange. How do you suppose to display the data if the table contains more rows than the visible area?
Anyway, you can try the following:
1) Define a panel with BorderLayout 2) Add the table to the CENTER
3) Add the table header to NORTH
i know how to set borders, just not how to post screenshots to java ranch.
And i decided you were right the scroll pane is the way i should be going so i have concentrated my efforts on that.
And when using images big enough in my demo program i mananged to reproduce the tiny table.
I figured you would have your own huge pictures you could replace it with , as i needed everything on the screen to need lots of space and images where easiest
And call me a purest but i wanted to know where the outlines that are meant to be there went when I made my own they appeared but...
Ok. At a risk of sounding daft, I need to clarify things.
1) Are we still talking about the vanishing top and left areas? In your later post you agreed the scroll panel was a good idea. Also, your latest code uses the scroll panel.
2) I looked at the screen shot. I can't figure out what am I supposed to observe in the red oval. Doh!
I am attaching my screen shot. It is from the code snippet I posted.
The only change I did was
Since the data is not clearly visible, the scrollbar is showing up.
The solution would be to resize the other panels to provide sufficient space for the table.
Since you have not explicitly set any scroll bar policy, they would disappear when the data is properly visible.