Hallo, ich habe ein Problem beim erstellen eines GUI. Implementiert habe ich das ganze mit BlueJ und mein Betriebssystem ist Ubuntu, habe Open JDK Java 8. Bin das ganze mit dem Debugger durchgegangen und das Problem scheint in Zeile 12 beim Befehl setVisible(true) zu liegen. Meine Internetrecherche hat ergeben, dass NoClassDefFoundError auftritt, wenn das Programm während der Laufzeit eine Klasse nicht findet, die beim compilieren aber noch zu finden war (? oder so ähnlich? Bin ein blutiger Anfänger...). Das hat mir jetzt leider noch nicht so richtig weitergeholfen und ich komme echt nicht dahinter, wie sich das Problem lösen lässt...
Code:
Fehlermeldung:
Wäre echt cool, wenn mir jemand helfen kann
Danke
Code:
Java:
import javax.swing.*;
public class GUI
{
public static void main (String[] args)
{
GUI window = new GUI("Lisa rennt - Routenberechnung");
window.mainWindow.setVisible(true);
}
private JFrame mainWindow;
Listener listener;
Routenrechner rechner;
JPanel fehlermeldung;
public GUI(String name)
{
mainWindow = new JFrame();
mainWindow.setTitle(name);
mainWindow.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
mainWindow.setSize(300,300);
JPanel mainPanel = new JPanel();
mainWindow.add(mainPanel);
JLabel description = new JLabel("Dieses Programm berechnet die optimale Route von Lisas Haus zur Landstraße und den letztmöglichen Zeitpunkt, zu dem Lisa ihr Haus spätestens verlassen muss, um den Bus mit Hilfe dieser Route zu erreichen.");
mainPanel.add(description);
listener = new Listener(this);
fehlermeldung = new JPanel();
mainWindow.add(fehlermeldung);
fehlermeldung.setVisible(false);
JButton open = new JButton("Datei öffnen");
open.addActionListener(listener);
mainPanel.add(open);
mainWindow.pack();
}
Fehlermeldung:
Java:
Exception in thread "AWT-EventQueue-1" java.lang.NoClassDefFoundError: javafx/scene/input/KeyCombination
at bluej.utility.Utility.appToFront(Utility.java:560)
at bluej.utility.Utility.bringToFront(Utility.java:539)
at bluej.runtime.ExecServer$2.eventDispatched(ExecServer.java:273)
at java.awt.Toolkit$SelectiveAWTEventListener.eventDispatched(Toolkit.java:2427)
at java.awt.Toolkit$ToolkitEventMulticaster.eventDispatched(Toolkit.java:2319)
at java.awt.Toolkit.notifyAWTEventListeners(Toolkit.java:2277)
at java.awt.Component.dispatchEventImpl(Component.java:4785)
at java.awt.Container.dispatchEventImpl(Container.java:2297)
at java.awt.Window.dispatchEventImpl(Window.java:2746)
at java.awt.Component.dispatchEvent(Component.java:4711)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:760)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:84)
at java.awt.EventQueue$4.run(EventQueue.java:733)
at java.awt.EventQueue$4.run(EventQueue.java:731)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:730)
at org.GNOME.Accessibility.AtkWrapper$6.dispatchEvent(AtkWrapper.java:715)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Caused by: java.lang.ClassNotFoundException: javafx.scene.input.KeyCombination
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 29 more
Wäre echt cool, wenn mir jemand helfen kann