Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Windows Look And Feel in Linux

843810Jan 18 2006 — edited Nov 10 2006
Hello,
Can anyone tell me how to get the WindowsLookAndFeel working in Linux. here is my code:

UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");

Font font = new Font("SansSerif", Font.PLAIN, 11);
UIManager.put("JLabel.font", font);
UIManager.put("JButton.font", font);
UIManager.put("JMenu.font", font);
UIManager.put("JToggleButton.font", font );
UIManager.put("JPanel.font", font);
UIManager.put("Button.font", font);

This code is working fine in Windows. But when I test it in Linux, the font is BOLD in place of PLAIN. And Also when I change the font size to 8 for example, the font does not change in Linux (11 and BOLD).

When I change the look and feel to com.sun.java.swing.plaf.motif.MotifLookAndFeel everything works fine.

Can anyone help me with this?
Thanks in advance
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 8 2006
Added on Jan 18 2006
4 comments
1,185 views