Denis
Denis

Reputation: 503

Java JFreeChart - how to add the button to the left of the name of graphics?

How to add the button to the left of the name of graphics in that area marked by red color?

enter image description here

    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

Answers (1)

trashgod
trashgod

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

Related Questions