>hello,
>
[quoted text clipped - 8 lines]
>shifted down and off the viewable area of the Jframe while the other
>panel (textfields/buttons) gets centered in the vieweable area.
I don't know offhand what the default layout manager for a JTabbedPane
is, but it sounds as if it might be FlowLayout, with the JList (now)
too big to fit on the same line as the other panel.
>I
>consider this worse than previously without the jtabbedpane since I
[quoted text clipped - 4 lines]
>layout can be caused by off hand? Is it due to the gridbaglayout and a
>certain property of the constraints or something else possibly?
I don't know GridbagLayout well - I hate it like poison and never use
it. Have you tried BoxLayout? I tend to use JPanelS with BoxLayout
inside JPanelS with BoxLayout, or BorderLayout for some things, and if
those don't work, I write my own LayoutManager (which sounds more
difficult than it is).
Pete Barrett
Brandon McCombs - 25 Jul 2005 23:58 GMT
> >hello,
> >
[quoted text clipped - 12 lines]
> is, but it sounds as if it might be FlowLayout, with the JList (now)
> too big to fit on the same line as the other panel.
But the thing is that the JList has no trouble at all fitting into the
JTabbedPane before data is added. And the data that is added to it is only
about 30 characters long and has plenty of room to fit into the JList but the
JList (before I used JTabbedPane) used to expand/resize to the left as I
mentioned previously and the data that would be listed would have a lot of
whitespace to the right of each entry. I tested to see if this whitespace
was actually part of the data by printing the data to the screen and adding
another character to the output and the character appeared right after my
real data so I knew there wasn't any hidden whitespace in my entry data. I
guess the problem of the layout position of the Jlist changing is due to the
size changing so the real problem is figuring out why the JList's size
changes in the first place, especially when it doesn't seem like to me that
it needs to.
> >I
> >consider this worse than previously without the jtabbedpane since I
[quoted text clipped - 7 lines]
> I don't know GridbagLayout well - I hate it like poison and never use
> it. Have you tried BoxLayout? I tend to use JPanelS with BoxLayout
I tried boxlayout. I can't remember what happened when I used it but it
wasn't what I wanted. I may have ended up with lots of spacing around my text
labels (if I'm remembering correctly) still, which was what I was trying to
fix.
> inside JPanelS with BoxLayout, or BorderLayout for some things, and if
> those don't work, I write my own LayoutManager (which sounds more
> difficult than it is).
>
> Pete Barrett
Brandon McCombs - 26 Jul 2005 03:24 GMT
> >hello,
> >
[quoted text clipped - 28 lines]
>
> Pete Barrett
Just wanted to say I fixed the problem myself. It seems in my infinite
genius I had the JList added to 2 different JScrollPanes and not only that,
but I was adding the JList itself (and not even either one of the
scrollPanes) to the JPanel. I removed a scrollpane (obviously unneeded) and
modified the JPanel add method's argument to be the leftover scrollpane and
not the JList and now the JList doesn't shift in size.
thanks for your help Pete.