Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
Hi, First I'd like to point out that this is my first post so go easy on me, second I'm a sort of beginner so if I don't make any sense just go on, however I don't need a very elaborate answers I can afford a Google search. Lets Begin:
I want to add a JTable to a null layout if possible
Why are you using a null layout? The layout managers are all designed to maintain the arrangement of child components when the display is resized, so you would do better to use a specific layout. I know they take time to learn, but it is worth the effort.
What is wrong with this?You will of course have to ensure there are no other child components being added which occupy the same space.
There are details about layouts in the Java Tutorials, and there is a helper class for GirdBagLayout here. If you can find a copy of Horstmann’s book, it tells you a lot more about GridBagLayout; the classic tutorial (no, classic anti-tutorial ) shows how awkward GridBag can be. It is worth Googling for MigLayout, which I have never tried, but a lot of people say it is better and easier to use than GridBag.
That will give you a layout, only the button on the right will probably appear rather tall and thin.
Thanks mate, I never knew about setting bounds for tables guess it works for most containers as well. that fixed my problem..
I was using this prior to your solution
myTable.setPreferredScrollableViewportSize(new Dimension(100, 450));
I'm not dead! I feel happy! I'd like to go for a walk! I'll even read a tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss