i am trying to create GUI using java swings.I am just a beginner in java swings.
My primary idea was to create two tabs and add a button in one of the tabs.
I'm not sure I understand your intent, but you might try the approach shown in the TabComponentsDemo, discussed in How to Use Tabbed Panes: Tabs With Custom Components.