G
Guest
Gast
Erzeuge tabs:
Codeteile von createChartPanel1:
Die toolbar wird aber nicht dargestellt, wo liegt mein fehler?
Ich brauch auf jedem tab eine eigene toolbar, wer kann mir dazu tipps geben?
Code:
private JTabbedPane createContent() {
JTabbedPane tabs = new JTabbedPane();
tabs.add("EINS", createChartPanel1());
tabs.add("ZWEI", createChartPanel2());
tabs.add("DREI", createChartPanel3());
return tabs;
}
Codeteile von createChartPanel1:
Code:
JToolBar toolbartest = new JToolBar(BorderLayout.NORTH);
toolbartest.setOrientation(JToolBar.HORIZONTAL);
toolbartest.setBackground(Color.white);
toolbartest.setFloatable(false);
JScrollBar scrollbartest = new JScrollBar();
scrollbartest.setModel(new DefaultBoundedRangeModel());
scrollbartest.setOrientation(JToolBar.HORIZONTAL);
toolbartest.add(scrollbartest);
ImageIcon icon1 = new ImageIcon ("/icons/icon1.gif");
xzoominButton = new JButton(icon1);
prepareButton(xzoominButton, ACTION_CMD_ZOOM_IN_X, "Zoom in");
toolbartest.add(xzoominButton);
final JPanel content = new JPanel(new BorderLayout());
chartPanel = new ChartPanel(chart);
chartPanel.setPopupMenu(null);
content.add(chartPanel);
content.add(toolbartest);
chartPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
setContentPane(content);
Ich brauch auf jedem tab eine eigene toolbar, wer kann mir dazu tipps geben?