I think i don't have something set correctly, but when I try to use JTabbedPanes it never loads correctly. If I have 3 tabs, tab 3 loads up first and I have to select all the tabs at least once before it works correctly.
Here is an example of what i mean. I used this program written by Dave Marshall to see where i was messing up, but i get the same problem when i run it.m Any help would be great!
[ January 22, 2008: Message edited by: Andy Lukavich ]
When the program loads, I want Tab 1 to be displayed. However when I load the program, Tab 3 loads instead. I then proceed to select Tab 1 (but tab 3 is displayed), then Tab 2(but tab 3 is displayed), then Tab 3. Once I select all three of them, when i select tab 1 again it loads with the correct information.
Interesting... I copied and pasted the code exactly, and it works fine for me - shows tab 1, exactly as you expect, and the tabs work properly too.
My only suggestions are adding the tabs in the opposite order - perhaps Tab 3 is selected because it was the last one you added? Also, have you tried only adding one tab, then two, to see if that shows anything obvious that could be wrong? Finally - I assume you have read the API for JTabbedPane, and this page from the Java Tutorial?
[Edit: PS - thanks for adding the code tags ] [ January 23, 2008: Message edited by: David Payne ]
This looks like a job for .... legal tender! It says so right in this tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth