Monday, August 30, 2010

How Many Calories In One Small Shrimp

Customize JFrame in Java theme to theme Windows


When we have to make a program that uses Windows, usually did not start the code from scratch is not designed the code window, not put the buttons with code, but simply with Netbeans all we do is drag and drop buttons and all the things you need, make it the default Netbeans is generating code alone, but if something does not fit is that the issue of windows OS, NetBeans generates the theme as the default window that appears in both Linux and Java, in this case if we are working on a Windows application would be best to adapt the Windows-style form. For this there are several ways a form using the following code is put in the constructor Form so that it is as follows: public
Window () {
try {
UIManager.setLookAndFeel (com.sun.java.swing.plaf.windows. WindowsLookAndFeel ");
} catch (Exception e) {
}
initComponents ();
}
The results are:
















You may not see the difference but when the window will be adding buttons, text fields , etc. will be the difference.