JTabbedPane auto-resize

I am developing a Java Swing application with Net-Beans. the application has a JFrame with tabbed panes. Now the problem is that when the frame is maximized, the tabbed pane only covers half the page …