[Original] Swing Skills. 4: Setting the System Window Border This is exclusive, set the system window, border, title, minimize, restore, maximize buttons, this is not clear, write a swings to look at the effect. Most It's easy to use Metal, that is, I don't change L & F. I am put the statement in swingset2, using different LookAndfeel experiments .1. Method 1: Global settings, before the first window New: Jframe.SetDefaultlookandfeelDecorated (TRUE); JFRAME , JDialog.setDefaultLookAndFeelDecoratedstatic global setting, Provides a hint as to whether or not newly created JDialogs and JFrames should have their window decorations (such as borders, widgets to close the window, title ...) provided by the current look and feel. 2 method 2: to a separate window if (currentLookAndFeel.getSupportsWindowDecorations ()) {frame.setUndecorated (true); frame.getRootPane () setWindowDecorationStyle (JRootPane.FRAME);.} // Returns true if the LookAndFeel returned RootPaneUI instances support providing window decorations in a JRootPane if (currentLookAndFeel.getSupportsWindowDecorations ()) {// Disables or enables decorations for this frame This method can only be called while the frame is not displayable frame.setUndecorated (true);... // Sets the type of Window Decorations (Such as borders, widgets for closing a Window, title ...) the JRootPane should provide frame.getRootPane () setWindowDecorationStyle (JRootPane.FRAME);.. / * JRootPane Constant used for the windowDecorationStyle property * NONE = 0;. FRAME = 1; plain_dialog = 2; * information_dialog = 3; error_dialog = 4; * color_chooser_dialog = 5; file_chooser_dialog = 6; * Question_Dialog = 7; Warning_Dialog = 8; * /}
SwingSet2 Screenshot 1: Metal Lookandfeel
Swingset2 Screenshot 2: Windows Lookandfeel, no border
SwingSet2 Screenshot 3: Metouia LookandFeel
Swingset2 screenshot 4: Oyoaha Lookandfeel
SwingSet2 Screenshot 5: 3D Lookandfeel, no border
SwingSet2 Screenshot 6: Motif Lookandfeel, no border