Исключение с JFreechart в JInternalFrame

По сути, я хочу Java GUI с несколькими кадрами, поэтому я используюJInternalFrame, но когда я добавляю свой график (созданный изJFreeChart) к одному из кадров, это дало мне исключение.

Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: javax.swing.plaf.ColorUIResource cannot be cast to java.util.List
at javax.swing.plaf.metal.MetalUtils.drawGradient(Unknown Source)
at javax.swing.plaf.metal.MetalInternalFrameTitlePane.paintComponent(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintToOffscreen(Unknown Source)
at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(Unknown Source)
at javax.swing.RepaintManager$PaintManager.paint(Unknown Source)
at javax.swing.RepaintManager.paint(Unknown Source) ....

Это код:

public class immobile extends JFrame {

    JDesktopPane desktop;

    public immobile() {
        desktop = new JDesktopPane();
        desktop.setDesktopManager(new No1DragDesktopManager());
        getContentPane().add(desktop);

        desktop.add(createInternalFrame(30, 50, Color.WHITE));
        desktop.add(createInternalFrame(30, 360, Color.WHITE));
        desktop.add(createInternalFrame(630, 50, Color.WHITE));
        desktop.add(createInternalFrame(630, 360, Color.WHITE));
    }

    private JInternalFrame createInternalFrame(
            int location1, int location2, Color background) {
        JInternalFrame internal =
            new JInternalFrame("Frame" + location1, true, true, true, true);
        internal.setBackground(background);
        internal.setVisible(true);
        internal.setResizable(false);
        internal.setBounds(location1, location2, 600, 310);
        internal.setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
        return internal;
    }

    public static void main(String args[]) {
        immobile frame = new immobile();
        frame.setDefaultCloseOperation(EXIT_ON_CLOSE);
        frame.setSize(1280, 720);
        frame.setLocationRelativeTo(null);
        frame.setVisible(true);
        frame.setResizable(false);
        try {
            JInternalFrame[] frames = frame.desktop.getAllFrames();
            JInternalFrame f = frames[0];

            String url = "http://www.cophieu68.com/export/excel.php?id=ABT";
            //create the chart from JFreechart//
            JFreeChart chart = garch_project.garch_chart(url);

            JPanel chartPanel = new ChartPanel(chart);
            f.add(chartPanel);
            f.putClientProperty("dragMode", "fixed");
            JInternalFrame f3 = frames[2];
            f3.putClientProperty("dragMode", "fixed");
            JInternalFrame f4 = frames[1];
            f4.putClientProperty("dragMode", "fixed");
            JInternalFrame f2 = frames[3];
            f2.putClientProperty("dragMode", "fixed");
        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }

    class No1DragDesktopManager extends DefaultDesktopManager {

        public void beginDraggingFrame(JComponent f) {
            if (!"fixed".equals(f.getClientProperty("dragMode"))) {
                super.beginDraggingFrame(f);
            }
        }

        public void dragFrame(JComponent f, int newX, int newY) {
            if (!"fixed".equals(f.getClientProperty("dragMode"))) {
                super.dragFrame(f, newX, newY);
            }
        }

        public void endDraggingFrame(JComponent f) {
            if (!"fixed".equals(f.getClientProperty("dragMode"))) {
                super.endDraggingFrame(f);
            }
        }
    }
}

Как я мог справиться с ними? Благодарю. (Я использую Eclipse, последняя версия).

Ответы на вопрос(1)

Ваш ответ на вопрос