Answer the question
In order to leave comments, you need to log in
How to use standard OS design for an application?
Taken from the forum, but does not work
public Frame(){
uiManager = new UIManager();
try {
uiManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
setTitle("Program v1.0.0.1");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setLocationRelativeTo(null);
setSize(500, 600);
/**
* Меню бар
*/
JMenuBar();
setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
Answer the question
In order to leave comments, you need to log in
On Windows, this should work: javax.swing.UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question