JScrollPane is not showing the frame properly
-
I have this code in which I have
JTabbedPane tabbedPane = new JTabbedPane();
and I have
JScrollPane scroll_pane = new JScrollPane(tabbedPane);
But when the JFrame shows up it is blank and after I click the maximize (Window) button it shows up the content on the frame. why is this happening?
frame.setPreferredSize(new Dimension(1500, 1210));
frame.setDefaultCloseOperation(JFrame.DISPOSE\_ON\_CLOSE); frame.pack(); frame.setResizable(true); frame.setVisible(true);
-
I have this code in which I have
JTabbedPane tabbedPane = new JTabbedPane();
and I have
JScrollPane scroll_pane = new JScrollPane(tabbedPane);
But when the JFrame shows up it is blank and after I click the maximize (Window) button it shows up the content on the frame. why is this happening?
frame.setPreferredSize(new Dimension(1500, 1210));
frame.setDefaultCloseOperation(JFrame.DISPOSE\_ON\_CLOSE); frame.pack(); frame.setResizable(true); frame.setVisible(true);
To add anything in scrollPane , try this
jscrollpane.setViewPortView(...)
Regards Shubhashish