Ich veruche ein JScrollPane in ein JTabbedPane reinzubekommen.
Leider geht das nicht, es gibt mir eine ArrayOuofbounds exeption und der tab verschwindet mit dem Jpanel geht es.
Mit Jpanel:
Beide versuche mit dem JScrollPane:
Leider geht das nicht, es gibt mir eine ArrayOuofbounds exeption und der tab verschwindet mit dem Jpanel geht es.
Mit Jpanel:
Code:
sploty.frame.mainPanel.tabs.setComponentAt(tabIndex, site.getjPanel());
Code:
sploty.frame.mainPanel.tabs.setComponentAt(tabIndex, new JScrollPane(panel));
Code:
JPanel panel = new JPanel();
panel.setLayout(new BorderLayout());
JScrollPane scrollPanel = new JScrollPane(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
scrollPanel.setViewportView(site.getjPanel());
scrollPanel.setPreferredSize(new Dimension(400,400));
panel.add(scrollPanel, BorderLayout.CENTER);
sploty.frame.mainPanel.tabs.setComponentAt(tabIndex, panel);