A
A
Anton @ Lyalin2017-02-26 11:22:26
Java
Anton @ Lyalin, 2017-02-26 11:22:26

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

1 answer(s)
I
Igor Makhov, 2017-03-06
@Igorgro

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 question

Ask a Question

731 491 924 answers to any question