I have this code (Sample code not a full code)
Code:
JTabbedPane tabbedPane = new JTabbedPane();
    JPanel jp1 = new JPanel();
 JScrollPane scroll_pane = new JScrollPane(tabbedPane);
jp1.setLayout(new BorderLayout());
frame.add(scroll_pane);
		scroll_pane.add(jp1);
and in the main method

Code:
frame.setPreferredSize(new Dimension(1500, 1210));		
        //frame.setLocationRelativeTo(null); //to appear frame in the center of the window screen
        frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
        frame.pack();
        frame.setResizable(true);
        frame.setVisible(true);
Now the problem is when the frame is loaded I have to click on maximize button(In top hand right corner) to maximize and to see the content of the frame ,otherwise the content(Labels and text boxes) are not visible.
why is this happening?