下面列出了javax.swing.JDialog#setDefaultLookAndFeelDecorated ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
public static void main(String[] args) {
UIManager.put("swing.boldMetal", Boolean.FALSE);
JDialog.setDefaultLookAndFeelDecorated(true);
JFrame.setDefaultLookAndFeelDecorated(true);
Toolkit.getDefaultToolkit().setDynamicLayout(true);
System.setProperty("sun.awt.noerasebackground", "true");
try {
UIManager.setLookAndFeel(new MetalLookAndFeel());
} catch (UnsupportedLookAndFeelException e) {
System.out.println(
"Metal Look & Feel not supported on this platform. \n"
+ "Program Terminated");
System.exit(0);
}
JFrame frame = new MetalworksFrame();
frame.setVisible(true);
}
public static void main(String[] args) {
UIManager.put("swing.boldMetal", Boolean.FALSE);
JDialog.setDefaultLookAndFeelDecorated(true);
JFrame.setDefaultLookAndFeelDecorated(true);
Toolkit.getDefaultToolkit().setDynamicLayout(true);
System.setProperty("sun.awt.noerasebackground", "true");
try {
UIManager.setLookAndFeel(new MetalLookAndFeel());
} catch (UnsupportedLookAndFeelException e) {
System.out.println(
"Metal Look & Feel not supported on this platform. \n"
+ "Program Terminated");
System.exit(0);
}
JFrame frame = new MetalworksFrame();
frame.setVisible(true);
}
/**
* 据BeautyEyeLNFHelper.frameBorderStyle指明的窗口边框类型来
* 决定是否使用操作系统相关的窗口装饰样式.
*/
static void initLookAndFeelDecorated()
{
if(BeautyEyeLNFHelper.frameBorderStyle == FrameBorderStyle.osLookAndFeelDecorated)
{
JFrame.setDefaultLookAndFeelDecorated(false);
JDialog.setDefaultLookAndFeelDecorated(false);
}
else
{
JFrame.setDefaultLookAndFeelDecorated(true);
JDialog.setDefaultLookAndFeelDecorated(true);
}
// UIManager.put("swing.aatext", Boolean.FALSE);
}
public static void main(String[] args) {
UIManager.put("swing.boldMetal", Boolean.FALSE);
JDialog.setDefaultLookAndFeelDecorated(true);
JFrame.setDefaultLookAndFeelDecorated(true);
Toolkit.getDefaultToolkit().setDynamicLayout(true);
System.setProperty("sun.awt.noerasebackground", "true");
try {
UIManager.setLookAndFeel(new MetalLookAndFeel());
} catch (UnsupportedLookAndFeelException e) {
System.out.println(
"Metal Look & Feel not supported on this platform. \n"
+ "Program Terminated");
System.exit(0);
}
JFrame frame = new MetalworksFrame();
frame.setVisible(true);
}
public static void main(String[] args) {
UIManager.put("swing.boldMetal", Boolean.FALSE);
JDialog.setDefaultLookAndFeelDecorated(true);
JFrame.setDefaultLookAndFeelDecorated(true);
Toolkit.getDefaultToolkit().setDynamicLayout(true);
System.setProperty("sun.awt.noerasebackground", "true");
try {
UIManager.setLookAndFeel(new MetalLookAndFeel());
} catch (UnsupportedLookAndFeelException e) {
System.out.println(
"Metal Look & Feel not supported on this platform. \n"
+ "Program Terminated");
System.exit(0);
}
JFrame frame = new MetalworksFrame();
frame.setVisible(true);
}
private static void setLookAndFeel()
{
try
{
String useSystemLookAndFeelProperty = System
.getProperty("useSystemLaF");
if (Boolean.valueOf(useSystemLookAndFeelProperty))
{
UIManager.setLookAndFeel(UIManager
.getSystemLookAndFeelClassName());
} else
{
UIManager
.setLookAndFeel("org.pushingpixels.substance.api.skin.SubstanceDustLookAndFeel");
JFrame.setDefaultLookAndFeelDecorated(true);
JDialog.setDefaultLookAndFeelDecorated(true);
}
} catch (Exception ex)
{
logger.warn(ex.getMessage(), ex);
}
}
public static void main(String[] args) {
UIManager.put("swing.boldMetal", Boolean.FALSE);
JDialog.setDefaultLookAndFeelDecorated(true);
JFrame.setDefaultLookAndFeelDecorated(true);
Toolkit.getDefaultToolkit().setDynamicLayout(true);
System.setProperty("sun.awt.noerasebackground", "true");
try {
UIManager.setLookAndFeel(new MetalLookAndFeel());
} catch (UnsupportedLookAndFeelException e) {
System.out.println(
"Metal Look & Feel not supported on this platform. \n"
+ "Program Terminated");
System.exit(0);
}
JFrame frame = new MetalworksFrame();
frame.setVisible(true);
}
public static void main(String[] args) {
UIManager.put("swing.boldMetal", Boolean.FALSE);
JDialog.setDefaultLookAndFeelDecorated(true);
JFrame.setDefaultLookAndFeelDecorated(true);
Toolkit.getDefaultToolkit().setDynamicLayout(true);
System.setProperty("sun.awt.noerasebackground", "true");
try {
UIManager.setLookAndFeel(new MetalLookAndFeel());
} catch (UnsupportedLookAndFeelException e) {
System.out.println(
"Metal Look & Feel not supported on this platform. \n"
+ "Program Terminated");
System.exit(0);
}
JFrame frame = new MetalworksFrame();
frame.setVisible(true);
}
public static void main(String[] args) {
UIManager.put("swing.boldMetal", Boolean.FALSE);
JDialog.setDefaultLookAndFeelDecorated(true);
JFrame.setDefaultLookAndFeelDecorated(true);
Toolkit.getDefaultToolkit().setDynamicLayout(true);
System.setProperty("sun.awt.noerasebackground", "true");
try {
UIManager.setLookAndFeel(new MetalLookAndFeel());
} catch (UnsupportedLookAndFeelException e) {
System.out.println(
"Metal Look & Feel not supported on this platform. \n"
+ "Program Terminated");
System.exit(0);
}
JFrame frame = new MetalworksFrame();
frame.setVisible(true);
}
@Override
public void uninitialize() {
// remove desktop property listener
if( desktopPropertyListener != null ) {
Toolkit toolkit = Toolkit.getDefaultToolkit();
toolkit.removePropertyChangeListener( desktopPropertyName, desktopPropertyListener );
if( desktopPropertyName2 != null )
toolkit.removePropertyChangeListener( desktopPropertyName2, desktopPropertyListener );
toolkit.removePropertyChangeListener( DESKTOPFONTHINTS, desktopPropertyListener );
desktopPropertyName = null;
desktopPropertyName2 = null;
desktopPropertyListener = null;
}
// uninstall popup factory
if( oldPopupFactory != null ) {
PopupFactory.setSharedInstance( oldPopupFactory );
oldPopupFactory = null;
}
// uninstall mnemonic handler
if( mnemonicHandler != null ) {
mnemonicHandler.uninstall();
mnemonicHandler = null;
}
// restore default link color
new HTMLEditorKit().getStyleSheet().addRule( "a { color: blue; }" );
postInitialization = null;
// restore enable/disable window decorations
if( oldFrameWindowDecorated != null ) {
JFrame.setDefaultLookAndFeelDecorated( oldFrameWindowDecorated );
JDialog.setDefaultLookAndFeelDecorated( oldDialogWindowDecorated );
oldFrameWindowDecorated = null;
oldDialogWindowDecorated = null;
}
super.uninitialize();
}
private static void lookAndFeel() {
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
JFrame.setDefaultLookAndFeelDecorated(true);
JDialog.setDefaultLookAndFeelDecorated(true);
} catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException e) {
JOptionPane.showMessageDialog(null, e, "Erro", JOptionPane.ERROR_MESSAGE);
}
}
/**
* The main method for <code>this</code> sample. The arguments are ignored.
*
* @param args
* Ignored.
*/
public static void main(String[] args) {
JFrame.setDefaultLookAndFeelDecorated(true);
JDialog.setDefaultLookAndFeelDecorated(true);
SwingUtilities.invokeLater(() -> {
SubstanceCortex.GlobalScope.setSkin(new BusinessBlackSteelSkin());
new RegisterTabCloseChangeListener_GeneralMultipleVetoable().setVisible(true);
});
}
/**
* The main method for <code>this</code> sample. The arguments are ignored.
*
* @param args
* Ignored.
*/
public static void main(String[] args) {
JDialog.setDefaultLookAndFeelDecorated(true);
JFrame.setDefaultLookAndFeelDecorated(true);
SwingUtilities.invokeLater(() -> {
SubstanceCortex.GlobalScope.setSkin(new BusinessBlackSteelSkin());
new GetAllTabCloseListeners_Global().setVisible(true);
});
}
/**
* The main method for <code>this</code> sample. The arguments are ignored.
*
* @param args
* Ignored.
*/
public static void main(String[] args) {
JFrame.setDefaultLookAndFeelDecorated(true);
JDialog.setDefaultLookAndFeelDecorated(true);
SwingUtilities.invokeLater(() -> {
SubstanceCortex.GlobalScope.setSkin(new BusinessBlackSteelSkin());
new RegisterTabCloseChangeListener_SpecificMultipleVetoable().setVisible(true);
});
}
/**
* The main method for <code>this</code> sample. The arguments are ignored.
*
* @param args
* Ignored.
*/
public static void main(String[] args) {
JFrame.setDefaultLookAndFeelDecorated(true);
JDialog.setDefaultLookAndFeelDecorated(true);
SwingUtilities.invokeLater(() -> {
SubstanceCortex.GlobalScope.setSkin(new BusinessBlackSteelSkin());
new SetSkin_Instance().setVisible(true);
});
}
/**
* Cancels the currently selected transport item.
*/
private void cancelTransportItem() {
String msg = "Note: you have highlighted a mission on the top-left box 'Incoming Transport Items' and clicked on the 'Discard Mission' button.";
// if (mainScene != null) {
// Platform.runLater(() -> {
// askFX(msg);
// });
// }
// else {
// Add a dialog box asking the user to confirm "discarding" the mission
JDialog.setDefaultLookAndFeelDecorated(true);
final int response = JOptionPane.showConfirmDialog(null, msg, "Confirm",
JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);
if (response == JOptionPane.NO_OPTION) {
// "No" button click, do nothing
} else if (response == JOptionPane.YES_OPTION) {
// "Yes" button clicked and go ahead with discarding this mission
Transportable transportItem = (Transportable) incomingListPane.getIncomingList().getSelectedValue();
if (transportItem != null) {
// call cancelTransportItem() in TransportManager Class to cancel the selected transport item.
Simulation.instance().getTransportManager().cancelTransportItem(transportItem);
}
} else if (response == JOptionPane.CLOSED_OPTION) {
// Close the dialogbox, do nothing
}
// }
}
/**
* The main method for <code>this</code> sample. The arguments are ignored.
*
* @param args
* Ignored.
*/
public static void main(String[] args) {
JFrame.setDefaultLookAndFeelDecorated(true);
JDialog.setDefaultLookAndFeelDecorated(true);
SwingUtilities.invokeLater(() -> {
SubstanceCortex.GlobalScope.setSkin(new BusinessBlackSteelSkin());
new SetSkin_ClassName().setVisible(true);
});
}
/**
* The main method for <code>this</code> sample. The arguments are ignored.
*
* @param args
* Ignored.
*/
public static void main(String[] args) {
JFrame.setDefaultLookAndFeelDecorated(true);
JDialog.setDefaultLookAndFeelDecorated(true);
SwingUtilities.invokeLater(() -> {
SubstanceCortex.GlobalScope.setSkin(new BusinessBlackSteelSkin());
new RegisterTabCloseChangeListener_GeneralSingleVetoable().setVisible(true);
});
}
public static void main(String[] args) throws Exception {
Logger rootLogger = Logger.getLogger("org.hihan.girinoscope");
rootLogger.setLevel(Level.INFO);
for (String arg : args) {
if ("-debug".equals(arg)) {
ConsoleHandler handler = new ConsoleHandler();
handler.setFormatter(new SimpleFormatter());
handler.setLevel(Level.ALL);
rootLogger.addHandler(handler);
}
}
JFrame.setDefaultLookAndFeelDecorated(true);
JDialog.setDefaultLookAndFeelDecorated(true);
try {
String[] allLafs = {
"javax.swing.plaf.nimbus.NimbusLookAndFeel",
"com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel",
UIManager.getSystemLookAndFeelClassName()
};
for (String laf : allLafs) {
if (setLookAndFeelIfAvailable(laf)) {
break;
}
}
} catch (Exception e) {
LOGGER.log(Level.WARNING, "When setting the look and feel.", e);
}
SwingUtilities.invokeAndWait(new Runnable() {
@Override
public void run() {
JFrame frame = new UI();
frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
frame.pack();
frame.setLocationRelativeTo(null);
frame.setVisible(true);
}
});
}
/**
* Returns the defaults for SeaGlassLookAndFeel.
*
* @return the UI defaults for SeaGlassLookAndFeel.
*/
@Override
public UIDefaults getDefaults() {
if (uiDefaults == null) {
uiDefaults = new UIWrapper(super.getDefaults());
// Install Keybindings for the operating system.
if (PlatformUtils.isWindows()) {
WindowsKeybindings.installKeybindings(uiDefaults);
} else if (PlatformUtils.isMac()) {
MacKeybindings.installKeybindings(uiDefaults);
} else {
GTKKeybindings.installKeybindings(uiDefaults);
}
// Set the default font.
defineDefaultFont(uiDefaults);
// Override some of the Synth UI delegates with copied and modified
// versions.
useOurUIs();
defineBaseColors(uiDefaults);
defineDefaultBorders(uiDefaults);
defineArrowButtons(uiDefaults);
defineButtons(uiDefaults);
defineComboBoxes(uiDefaults);
defineDesktopPanes(uiDefaults);
defineInternalFrames(uiDefaults);
defineInternalFrameMenuButtons(uiDefaults);
defineInternalFrameCloseButtons(uiDefaults);
defineInternalFrameIconifyButtons(uiDefaults);
defineInternalFrameMaximizeButton(uiDefaults);
defineLists(uiDefaults);
defineMenus(uiDefaults);
definePanels(uiDefaults);
definePopups(uiDefaults);
defineProgressBars(uiDefaults);
defineRootPanes(uiDefaults);
defineSeparators(uiDefaults);
defineSpinners(uiDefaults);
defineScrollBars(uiDefaults);
defineScrollPane(uiDefaults);
defineSliders(uiDefaults);
defineSplitPanes(uiDefaults);
defineTabbedPanes(uiDefaults);
defineTables(uiDefaults);
defineTextControls(uiDefaults);
defineToolBars(uiDefaults);
defineTrees(uiDefaults);
defineToolTips(uiDefaults);
defineOptionPane(uiDefaults);
defineFileChooser(uiDefaults);
if (!PlatformUtils.isMac()) {
uiDefaults.put("MenuBar[Enabled].backgroundPainter", null);
uiDefaults.put("MenuBar[Enabled].borderPainter", null);
// If we're not on a Mac, draw our own title bar.
JFrame.setDefaultLookAndFeelDecorated(true);
JDialog.setDefaultLookAndFeelDecorated(true);
} else {
// If we're on a Mac, use the screen menu bar.
System.setProperty("apple.laf.useScreenMenuBar", "true");
// If we're on a Mac, use Aqua for some things.
defineAquaSettings(uiDefaults);
}
}
return uiDefaults;
}