mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-11 06:27:13 -06:00
ProgressBar: If progress text is visible:
- use smaller font - reduced height - changed style to rounded rectangle - fixed painting issues on low values Support configure of arc with `ProgressBar.arc`
This commit is contained in:
@@ -38,7 +38,15 @@ public class FlatComponentsTest
|
||||
initComponents();
|
||||
}
|
||||
|
||||
private void indeterminateCheckBoxActionPerformed() {
|
||||
private void changeProgress() {
|
||||
int value = slider3.getValue();
|
||||
progressBar1.setValue( value );
|
||||
progressBar2.setValue( value );
|
||||
progressBar3.setValue( value );
|
||||
progressBar4.setValue( value );
|
||||
}
|
||||
|
||||
private void indeterminateProgress() {
|
||||
boolean indeterminate = indeterminateCheckBox.isSelected();
|
||||
progressBar1.setIndeterminate( indeterminate );
|
||||
progressBar2.setIndeterminate( indeterminate );
|
||||
@@ -166,7 +174,7 @@ public class FlatComponentsTest
|
||||
JLabel sliderLabel = new JLabel();
|
||||
JSlider slider1 = new JSlider();
|
||||
JSlider slider6 = new JSlider();
|
||||
JSlider slider3 = new JSlider();
|
||||
slider3 = new JSlider();
|
||||
JSlider slider5 = new JSlider();
|
||||
JLabel progressBarLabel = new JLabel();
|
||||
progressBar1 = new JProgressBar();
|
||||
@@ -737,12 +745,12 @@ public class FlatComponentsTest
|
||||
|
||||
//---- progressBar3 ----
|
||||
progressBar3.setOrientation(SwingConstants.VERTICAL);
|
||||
progressBar3.setValue(50);
|
||||
progressBar3.setValue(60);
|
||||
add(progressBar3, "cell 4 13 1 6,growy");
|
||||
|
||||
//---- progressBar4 ----
|
||||
progressBar4.setOrientation(SwingConstants.VERTICAL);
|
||||
progressBar4.setValue(55);
|
||||
progressBar4.setValue(60);
|
||||
progressBar4.setStringPainted(true);
|
||||
add(progressBar4, "cell 4 13 1 6,growy");
|
||||
|
||||
@@ -867,6 +875,7 @@ public class FlatComponentsTest
|
||||
slider3.setMajorTickSpacing(50);
|
||||
slider3.setPaintLabels(true);
|
||||
slider3.setValue(30);
|
||||
slider3.addChangeListener(e -> changeProgress());
|
||||
add(slider3, "cell 1 20 3 1,aligny top,grow 100 0");
|
||||
|
||||
//---- slider5 ----
|
||||
@@ -883,17 +892,17 @@ public class FlatComponentsTest
|
||||
add(progressBarLabel, "cell 0 21");
|
||||
|
||||
//---- progressBar1 ----
|
||||
progressBar1.setValue(50);
|
||||
progressBar1.setValue(60);
|
||||
add(progressBar1, "cell 1 21 3 1,growx");
|
||||
|
||||
//---- progressBar2 ----
|
||||
progressBar2.setStringPainted(true);
|
||||
progressBar2.setValue(55);
|
||||
progressBar2.setValue(60);
|
||||
add(progressBar2, "cell 1 21 3 1,growx");
|
||||
|
||||
//---- indeterminateCheckBox ----
|
||||
indeterminateCheckBox.setText("indeterminate");
|
||||
indeterminateCheckBox.addActionListener(e -> indeterminateCheckBoxActionPerformed());
|
||||
indeterminateCheckBox.addActionListener(e -> indeterminateProgress());
|
||||
add(indeterminateCheckBox, "cell 4 21");
|
||||
|
||||
//---- toolTipLabel ----
|
||||
@@ -952,6 +961,7 @@ public class FlatComponentsTest
|
||||
// JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables
|
||||
private JProgressBar progressBar3;
|
||||
private JProgressBar progressBar4;
|
||||
private JSlider slider3;
|
||||
private JProgressBar progressBar1;
|
||||
private JProgressBar progressBar2;
|
||||
private JCheckBox indeterminateCheckBox;
|
||||
|
||||
@@ -673,7 +673,7 @@ new FormModel {
|
||||
add( new FormComponent( "javax.swing.JProgressBar" ) {
|
||||
name: "progressBar3"
|
||||
"orientation": 1
|
||||
"value": 50
|
||||
"value": 60
|
||||
auxiliary() {
|
||||
"JavaCodeGenerator.variableLocal": false
|
||||
}
|
||||
@@ -683,7 +683,7 @@ new FormModel {
|
||||
add( new FormComponent( "javax.swing.JProgressBar" ) {
|
||||
name: "progressBar4"
|
||||
"orientation": 1
|
||||
"value": 55
|
||||
"value": 60
|
||||
"stringPainted": true
|
||||
auxiliary() {
|
||||
"JavaCodeGenerator.variableLocal": false
|
||||
@@ -836,6 +836,10 @@ new FormModel {
|
||||
"majorTickSpacing": 50
|
||||
"paintLabels": true
|
||||
"value": 30
|
||||
auxiliary() {
|
||||
"JavaCodeGenerator.variableLocal": false
|
||||
}
|
||||
addEvent( new FormEvent( "javax.swing.event.ChangeListener", "stateChanged", "changeProgress", false ) )
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 1 20 3 1,aligny top,grow 100 0"
|
||||
} )
|
||||
@@ -858,7 +862,7 @@ new FormModel {
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JProgressBar" ) {
|
||||
name: "progressBar1"
|
||||
"value": 50
|
||||
"value": 60
|
||||
auxiliary() {
|
||||
"JavaCodeGenerator.variableLocal": false
|
||||
}
|
||||
@@ -868,7 +872,7 @@ new FormModel {
|
||||
add( new FormComponent( "javax.swing.JProgressBar" ) {
|
||||
name: "progressBar2"
|
||||
"stringPainted": true
|
||||
"value": 55
|
||||
"value": 60
|
||||
auxiliary() {
|
||||
"JavaCodeGenerator.variableLocal": false
|
||||
}
|
||||
@@ -881,7 +885,7 @@ new FormModel {
|
||||
auxiliary() {
|
||||
"JavaCodeGenerator.variableLocal": false
|
||||
}
|
||||
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "indeterminateCheckBoxActionPerformed", false ) )
|
||||
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "indeterminateProgress", false ) )
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 4 21"
|
||||
} )
|
||||
|
||||
Reference in New Issue
Block a user