Hi folks,
I've written an application in Eclipse that uses a Swing GUI and it's been working fine for some time. I recently read about JavaFX and decided to try building a new GUI for my app using this new technology. So I created a new package in the Project to house the JavaFX implementation of my GUI. TO get this to work I had to change the JRE System Library of my project to 1.8.0_66 (previously it was JDK1.7.0_80).
What's happened is that my JavaFX GUI works fine. But when I try to launch my old Swing GUI I get a large number of ClassCastExceptions:
javax.swing.JButton cannot be cast to javax.swing.JMenuItem
javax.swing.JTextField cannot be cast to javax.swing.JMenuItem
javax.swing.JButton cannot be cast to javax.swing.JMenuItem
javax.swing.JTextField cannot be cast to javax.swing.JMenuItem
I'm not too worried about the impact of this on my project as I have everything backed up and if I get a working JavaFX GUI then I won't need to retain the old Swing classes. But what I want to know is why did upgrading the
Java Build Path of the project affect Swing?
Thanks