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)?
Asked
Active
Viewed 1,462 times
2 Answers
5
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");

Alexander Torstling
- 18,552
- 7
- 62
- 74
-
Haven't tired the first option, but the second works like a charm. Thank you! – bgw Jan 06 '10 at 20:20
1
Also you can set the Default Toolkit inside of swing directly, in a compiler-friendly way.
UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());

Andrew Thompson
- 168,117
- 40
- 217
- 433

jayunit100
- 17,388
- 22
- 92
- 167