Re: Netbeans UI not the same as if executed

Michael Bien <[email protected]> Sat, 05 Jul 2008 18:25:12 +0200
Newsgroups gmane.comp.java.netbeans.user-interface
Message-ID <[email protected]>
Hi,

the difference you see is caused because off different look&feels. 
NetBeans uses the system look and feel as default, but your app the 
swing cross platform l&f. (you can also preview with different look and 
feels via context menu)

simple put this into your code _before doing anything gui related:

            // switch to system look and feel
            try{
                
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
            }catch(Exception ex2) {
                // ignore
            }


regards,

michael


edelynn wrote:
> Hi, I am wondering how come the UI that I see in my netbeans design editor is
> as follows:
> http://www.nabble.com/file/p18293472/netbeans_design_preview.jpg 
>
> But when i execute the application, the actual UI is as follows:
> http://www.nabble.com/file/p18293472/executed_application.jpg 
>
> For the above example, the UI is not so far but for more complex UI, the
> actual result is not desirable compared to the one I see in the design
> preview. Is this really how it goes? or something is wrong with my settings?
>
> THanks lots!
>
>
>