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 ]