Reputation: 503
How to add the button to the left of the name of graphics in that area marked by red color?
chartPanel.setDomainZoomable(false);
chartPanel.setRangeZoomable(false);
chartPanel.setPopupMenu(null);
frame = new JFrame(Title);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.add(chartPanel);
frame.pack();
frame.setLocationRelativeTo(null);
frame.setVisible(true);
Upvotes: 1
Views: 1025
Reputation: 205855
To facilitate use on a headless server, a JFreeChart
is not a Swing JComponent
. The typical Swing approach is to enclose the chart in a ChartPanel
and add the panel to a suitable layout. Add controls to to an adjacent panel, as shown here and here using BorderLayout.SOUTH
.
Upvotes: 1