mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-11 22:47:13 -06:00
Demo: added "Options > Smooth Scrolling" to menu (issue #50)
This commit is contained in:
@@ -266,6 +266,10 @@ class DemoFrame
|
||||
repaint();
|
||||
}
|
||||
|
||||
private void smoothScrollingChanged() {
|
||||
UIManager.put( "ScrollPane.smoothScrolling", smoothScrollingMenuItem.isSelected() );
|
||||
}
|
||||
|
||||
private void animatedLafChangeChanged() {
|
||||
System.setProperty( "flatlaf.animatedLafChange", String.valueOf( animatedLafChangeMenuItem.isSelected() ) );
|
||||
}
|
||||
@@ -505,6 +509,7 @@ class DemoFrame
|
||||
showTitleBarIconMenuItem = new JCheckBoxMenuItem();
|
||||
underlineMenuSelectionMenuItem = new JCheckBoxMenuItem();
|
||||
alwaysShowMnemonicsMenuItem = new JCheckBoxMenuItem();
|
||||
smoothScrollingMenuItem = new JCheckBoxMenuItem();
|
||||
animatedLafChangeMenuItem = new JCheckBoxMenuItem();
|
||||
JMenuItem showHintsMenuItem = new JMenuItem();
|
||||
JMenuItem showUIDefaultsInspectorMenuItem = new JMenuItem();
|
||||
@@ -793,6 +798,12 @@ class DemoFrame
|
||||
alwaysShowMnemonicsMenuItem.addActionListener(e -> alwaysShowMnemonics());
|
||||
optionsMenu.add(alwaysShowMnemonicsMenuItem);
|
||||
|
||||
//---- smoothScrollingMenuItem ----
|
||||
smoothScrollingMenuItem.setText("Smooth Scrolling");
|
||||
smoothScrollingMenuItem.setSelected(true);
|
||||
smoothScrollingMenuItem.addActionListener(e -> smoothScrollingChanged());
|
||||
optionsMenu.add(smoothScrollingMenuItem);
|
||||
|
||||
//---- animatedLafChangeMenuItem ----
|
||||
animatedLafChangeMenuItem.setText("Animated Laf Change");
|
||||
animatedLafChangeMenuItem.setSelected(true);
|
||||
@@ -981,6 +992,7 @@ class DemoFrame
|
||||
private JCheckBoxMenuItem showTitleBarIconMenuItem;
|
||||
private JCheckBoxMenuItem underlineMenuSelectionMenuItem;
|
||||
private JCheckBoxMenuItem alwaysShowMnemonicsMenuItem;
|
||||
private JCheckBoxMenuItem smoothScrollingMenuItem;
|
||||
private JCheckBoxMenuItem animatedLafChangeMenuItem;
|
||||
private JMenuItem aboutMenuItem;
|
||||
private JToolBar toolBar;
|
||||
|
||||
@@ -418,6 +418,15 @@ new FormModel {
|
||||
}
|
||||
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "alwaysShowMnemonics", false ) )
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JCheckBoxMenuItem" ) {
|
||||
name: "smoothScrollingMenuItem"
|
||||
"text": "Smooth Scrolling"
|
||||
"selected": true
|
||||
auxiliary() {
|
||||
"JavaCodeGenerator.variableLocal": false
|
||||
}
|
||||
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "smoothScrollingChanged", false ) )
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JCheckBoxMenuItem" ) {
|
||||
name: "animatedLafChangeMenuItem"
|
||||
"text": "Animated Laf Change"
|
||||
|
||||
Reference in New Issue
Block a user