I am working on an embedded Linux device that has only qt. For some reason, Java decides to use gnu.java.awt.peer.gtk.GtkToolkit. How can I force it to use gnu.java.awt.peer.qt.QtToolkit instead (or change the default behavior)?
the api suggests setting the system property awt.toolkit,
java -Dawt.toolkit=gnu.java.awt.peer.qt.QtToolkit my.Program
or
System.setProperty ("awt.toolkit", "gnu.java.awt.peer.qt.QtToolkit");
Also you can set the Default Toolkit inside of swing directly, in a compiler-friendly way.
UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With