mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-12 15:07:11 -06:00
Demo: register F9 key for Mac Aqua LaF; changed Fx keys for Metal and Nimbus
This commit is contained in:
@@ -55,12 +55,13 @@ class ControlBar
|
||||
className.equals( "com.sun.java.swing.plaf.motif.MotifLookAndFeel" ) )
|
||||
continue;
|
||||
|
||||
if( className.equals( NimbusLookAndFeel.class.getName() ) )
|
||||
name += " (F10)";
|
||||
if( (SystemInfo.IS_WINDOWS && className.equals( "com.sun.java.swing.plaf.windows.WindowsLookAndFeel" )) ||
|
||||
(SystemInfo.IS_MAC && className.equals( "com.apple.laf.AquaLookAndFeel") ) )
|
||||
name += " (F9)";
|
||||
else if( className.equals( MetalLookAndFeel.class.getName() ) )
|
||||
name += " (F10)";
|
||||
else if( className.equals( NimbusLookAndFeel.class.getName() ) )
|
||||
name += " (F11)";
|
||||
else if( className.equals( "com.sun.java.swing.plaf.windows.WindowsLookAndFeel" ) )
|
||||
name += " (F12)";
|
||||
|
||||
lafModel.addElement( new LafInfo( name, className ) );
|
||||
}
|
||||
@@ -87,10 +88,12 @@ class ControlBar
|
||||
registerSwitchToLookAndFeel( KeyEvent.VK_F3, FlatIntelliJLaf.class.getName() );
|
||||
registerSwitchToLookAndFeel( KeyEvent.VK_F4, FlatDarculaLaf.class.getName() );
|
||||
|
||||
registerSwitchToLookAndFeel( KeyEvent.VK_F10, NimbusLookAndFeel.class.getName() );
|
||||
registerSwitchToLookAndFeel( KeyEvent.VK_F11, MetalLookAndFeel.class.getName() );
|
||||
if( SystemInfo.IS_WINDOWS )
|
||||
registerSwitchToLookAndFeel( KeyEvent.VK_F12, "com.sun.java.swing.plaf.windows.WindowsLookAndFeel" );
|
||||
registerSwitchToLookAndFeel( KeyEvent.VK_F9, "com.sun.java.swing.plaf.windows.WindowsLookAndFeel" );
|
||||
else if( SystemInfo.IS_MAC )
|
||||
registerSwitchToLookAndFeel( KeyEvent.VK_F9, "com.apple.laf.AquaLookAndFeel" );
|
||||
registerSwitchToLookAndFeel( KeyEvent.VK_F10, MetalLookAndFeel.class.getName() );
|
||||
registerSwitchToLookAndFeel( KeyEvent.VK_F11, NimbusLookAndFeel.class.getName() );
|
||||
|
||||
// register ESC key to close frame
|
||||
((JComponent)frame.getContentPane()).registerKeyboardAction(
|
||||
|
||||
Reference in New Issue
Block a user