@@ -67,17 +67,17 @@ public final class MainWindow implements Runnable, RipStatusHandler {
6767
6868 private static JLabel statusLabel ;
6969 private static final ProgressTextField currentlyRippingProgress = new ProgressTextField ();
70- private static final JLabel pendingValue = new JLabel ( "0" );
70+ private static final JLabel pendingValue = new MinimumWidthLabel ( "1000" , "0" );
7171 private static final JLabel pendingLabel = new JLabel ("Pending" );
72- private static final JLabel activeValue = new JLabel ( "0" );
72+ private static final JLabel activeValue = new MinimumWidthLabel ( "1000" , "0" );
7373 private static final JLabel activeLabel = new JLabel ("Active" );
74- private static final JLabel completedValue = new JLabel ( "0" );
74+ private static final JLabel completedValue = new MinimumWidthLabel ( "1000" , "0" );
7575 private static final JLabel completedLabel = new JLabel ("Completed" );
76- private static final JLabel erroredValue = new JLabel ( "0" );
76+ private static final JLabel erroredValue = new MinimumWidthLabel ( "1000" , "0" );
7777 private static final JLabel erroredLabel = new JLabel ("Errored" );
78- private static final JLabel totalValue = new JLabel ( "0" );
78+ private static final JLabel totalValue = new MinimumWidthLabel ( "1000" , "0" );
7979 private static final JLabel totalLabel = new JLabel ("Total" );
80- private static final JLabel transferRateValue = new JLabel ( "0.00 B/s" );
80+ private static final JLabel transferRateValue = new MinimumWidthLabel ( "999.00 KiB/s" , "0.00 B/s" );
8181 private static final JLabel transferRateLabel = new JLabel ("Speed" );
8282 private static final JButton openButton = new JButton ();
8383
@@ -400,10 +400,6 @@ public void replace(FilterBypass fb, int offset, int length, String text, Attrib
400400 pendingValue .setFont (monospaced );
401401 pendingValue .setHorizontalAlignment (JLabel .TRAILING );
402402 pendingValue .setBorder (valueLabelBorder );
403- pendingValue .setText ("1000" );
404- pendingValue .setPreferredSize (pendingValue .getPreferredSize ());
405- pendingValue .setMinimumSize (pendingValue .getPreferredSize ());
406- pendingValue .setText ("0" );
407403 gbc = new GridBagConstraints ();
408404 gbc .gridx = 0 ;
409405 gbc .gridy = 0 ;
@@ -417,10 +413,6 @@ public void replace(FilterBypass fb, int offset, int length, String text, Attrib
417413 activeValue .setFont (monospaced );
418414 activeValue .setHorizontalAlignment (JLabel .TRAILING );
419415 activeValue .setBorder (valueLabelBorder );
420- activeValue .setText ("1000" );
421- activeValue .setPreferredSize (activeValue .getPreferredSize ());
422- activeValue .setMinimumSize (activeValue .getPreferredSize ());
423- activeValue .setText ("0" );
424416 gbc = new GridBagConstraints ();
425417 gbc .gridx = 0 ;
426418 gbc .gridy = 1 ;
@@ -434,10 +426,6 @@ public void replace(FilterBypass fb, int offset, int length, String text, Attrib
434426 completedValue .setFont (monospaced );
435427 completedValue .setHorizontalAlignment (JLabel .TRAILING );
436428 completedValue .setBorder (valueLabelBorder );
437- completedValue .setText ("1000" );
438- completedValue .setPreferredSize (completedValue .getPreferredSize ());
439- completedValue .setMinimumSize (completedValue .getPreferredSize ());
440- completedValue .setText ("0" );
441429 gbc = new GridBagConstraints ();
442430 gbc .gridx = 3 ;
443431 gbc .gridy = 0 ;
@@ -451,10 +439,6 @@ public void replace(FilterBypass fb, int offset, int length, String text, Attrib
451439 erroredValue .setFont (monospaced );
452440 erroredValue .setHorizontalAlignment (JLabel .TRAILING );
453441 erroredValue .setBorder (valueLabelBorder );
454- erroredValue .setText ("1000" );
455- erroredValue .setPreferredSize (erroredValue .getPreferredSize ());
456- erroredValue .setMinimumSize (erroredValue .getPreferredSize ());
457- erroredValue .setText ("0" );
458442 gbc = new GridBagConstraints ();
459443 gbc .gridx = 3 ;
460444 gbc .gridy = 1 ;
@@ -468,10 +452,6 @@ public void replace(FilterBypass fb, int offset, int length, String text, Attrib
468452 totalValue .setFont (monospaced );
469453 totalValue .setHorizontalAlignment (JLabel .TRAILING );
470454 totalValue .setBorder (valueLabelBorder );
471- totalValue .setText ("1000" );
472- totalValue .setPreferredSize (totalValue .getPreferredSize ());
473- totalValue .setMinimumSize (totalValue .getPreferredSize ());
474- totalValue .setText ("0" );
475455 gbc = new GridBagConstraints ();
476456 gbc .gridx = 6 ;
477457 gbc .gridy = 0 ;
@@ -485,11 +465,6 @@ public void replace(FilterBypass fb, int offset, int length, String text, Attrib
485465 transferRateValue .setFont (monospaced );
486466 transferRateValue .setHorizontalAlignment (JLabel .TRAILING );
487467 transferRateValue .setBorder (valueLabelBorder );
488- transferRateValue .setText ("999.00 KiB/s" ); // Maximum width value
489- // Set preferred size to maximum width value
490- transferRateValue .setPreferredSize (transferRateValue .getPreferredSize ());
491- transferRateValue .setMinimumSize (transferRateValue .getPreferredSize ());
492- transferRateValue .setText ("0 B/s" ); // Restore default value
493468 gbc = new GridBagConstraints ();
494469 gbc .gridx = 6 ;
495470 gbc .gridy = 1 ;
@@ -516,8 +491,6 @@ public void replace(FilterBypass fb, int offset, int length, String text, Attrib
516491 gbc .fill = GridBagConstraints .HORIZONTAL ;
517492 statusDetailPanel .add (spacer2 , gbc );
518493
519- statusDetailPanel .setPreferredSize (new Dimension (350 , statusDetailPanel .getPreferredSize ().height ));
520-
521494 openButton .setVisible (false );
522495
523496 gbc = new GridBagConstraints ();
0 commit comments