Search code examples
javaswinglook-and-feelnimbus

Mixing look and feel


So far I have this

public static void main(String[] args) {
        try {
            UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel");
            UIManager.getBorder("design");//change look and feel here?
        } catch (Exception e) {
            JOptionPane.showMessageDialog(null, "Nimbus isn't available");
        }
        javax.swing.SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                design GUI = new design();
                GUI.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                GUI.setVisible(true);
            }
        });
    }

I'm trying to make the main look and feel nimbus, but change the titled border to windows.

My border is this:

contentPanel.setBorder(new TitledBorder("Downloader"));

Is it possible to do? If it is can someone point me where to look? I'm so confused right now. :\

Thanks.


Solution

  • I've done it. You have to create parts of the UI, and then call UIManager.setLookAndFeel() to change the look & feel, and then create the other parts. It's more like a hack.