@@ -66,17 +66,17 @@ public final class MainWindow implements Runnable, RipStatusHandler {
6666
6767 private static JLabel statusLabel ;
6868 private static final ProgressTextField currentlyRippingProgress = new ProgressTextField ();
69- private static final JLabel pendingValue = new JLabel ( "0" );
69+ private static final JLabel pendingValue = new MinimumWidthLabel ( "1000" , "0" );
7070 private static final JLabel pendingLabel = new JLabel ("Pending" );
71- private static final JLabel activeValue = new JLabel ( "0" );
71+ private static final JLabel activeValue = new MinimumWidthLabel ( "1000" , "0" );
7272 private static final JLabel activeLabel = new JLabel ("Active" );
73- private static final JLabel completedValue = new JLabel ( "0" );
73+ private static final JLabel completedValue = new MinimumWidthLabel ( "1000" , "0" );
7474 private static final JLabel completedLabel = new JLabel ("Completed" );
75- private static final JLabel erroredValue = new JLabel ( "0" );
75+ private static final JLabel erroredValue = new MinimumWidthLabel ( "1000" , "0" );
7676 private static final JLabel erroredLabel = new JLabel ("Errored" );
77- private static final JLabel totalValue = new JLabel ( "0" );
77+ private static final JLabel totalValue = new MinimumWidthLabel ( "1000" , "0" );
7878 private static final JLabel totalLabel = new JLabel ("Total" );
79- private static final JLabel transferRateValue = new JLabel ( "0.00 B/s" );
79+ private static final JLabel transferRateValue = new MinimumWidthLabel ( "999.00 KiB/s" , "0.00 B/s" );
8080 private static final JLabel transferRateLabel = new JLabel ("Speed" );
8181 private static final JButton openButton = new JButton ();
8282
@@ -399,10 +399,6 @@ public void replace(FilterBypass fb, int offset, int length, String text, Attrib
399399 pendingValue .setFont (monospaced );
400400 pendingValue .setHorizontalAlignment (JLabel .TRAILING );
401401 pendingValue .setBorder (valueLabelBorder );
402- pendingValue .setText ("1000" );
403- pendingValue .setPreferredSize (pendingValue .getPreferredSize ());
404- pendingValue .setMinimumSize (pendingValue .getPreferredSize ());
405- pendingValue .setText ("0" );
406402 gbc = new GridBagConstraints ();
407403 gbc .gridx = 0 ;
408404 gbc .gridy = 0 ;
@@ -416,10 +412,6 @@ public void replace(FilterBypass fb, int offset, int length, String text, Attrib
416412 activeValue .setFont (monospaced );
417413 activeValue .setHorizontalAlignment (JLabel .TRAILING );
418414 activeValue .setBorder (valueLabelBorder );
419- activeValue .setText ("1000" );
420- activeValue .setPreferredSize (activeValue .getPreferredSize ());
421- activeValue .setMinimumSize (activeValue .getPreferredSize ());
422- activeValue .setText ("0" );
423415 gbc = new GridBagConstraints ();
424416 gbc .gridx = 0 ;
425417 gbc .gridy = 1 ;
@@ -433,10 +425,6 @@ public void replace(FilterBypass fb, int offset, int length, String text, Attrib
433425 completedValue .setFont (monospaced );
434426 completedValue .setHorizontalAlignment (JLabel .TRAILING );
435427 completedValue .setBorder (valueLabelBorder );
436- completedValue .setText ("1000" );
437- completedValue .setPreferredSize (completedValue .getPreferredSize ());
438- completedValue .setMinimumSize (completedValue .getPreferredSize ());
439- completedValue .setText ("0" );
440428 gbc = new GridBagConstraints ();
441429 gbc .gridx = 3 ;
442430 gbc .gridy = 0 ;
@@ -450,10 +438,6 @@ public void replace(FilterBypass fb, int offset, int length, String text, Attrib
450438 erroredValue .setFont (monospaced );
451439 erroredValue .setHorizontalAlignment (JLabel .TRAILING );
452440 erroredValue .setBorder (valueLabelBorder );
453- erroredValue .setText ("1000" );
454- erroredValue .setPreferredSize (erroredValue .getPreferredSize ());
455- erroredValue .setMinimumSize (erroredValue .getPreferredSize ());
456- erroredValue .setText ("0" );
457441 gbc = new GridBagConstraints ();
458442 gbc .gridx = 3 ;
459443 gbc .gridy = 1 ;
@@ -467,10 +451,6 @@ public void replace(FilterBypass fb, int offset, int length, String text, Attrib
467451 totalValue .setFont (monospaced );
468452 totalValue .setHorizontalAlignment (JLabel .TRAILING );
469453 totalValue .setBorder (valueLabelBorder );
470- totalValue .setText ("1000" );
471- totalValue .setPreferredSize (totalValue .getPreferredSize ());
472- totalValue .setMinimumSize (totalValue .getPreferredSize ());
473- totalValue .setText ("0" );
474454 gbc = new GridBagConstraints ();
475455 gbc .gridx = 6 ;
476456 gbc .gridy = 0 ;
@@ -484,11 +464,6 @@ public void replace(FilterBypass fb, int offset, int length, String text, Attrib
484464 transferRateValue .setFont (monospaced );
485465 transferRateValue .setHorizontalAlignment (JLabel .TRAILING );
486466 transferRateValue .setBorder (valueLabelBorder );
487- transferRateValue .setText ("999.00 KiB/s" ); // Maximum width value
488- // Set preferred size to maximum width value
489- transferRateValue .setPreferredSize (transferRateValue .getPreferredSize ());
490- transferRateValue .setMinimumSize (transferRateValue .getPreferredSize ());
491- transferRateValue .setText ("0 B/s" ); // Restore default value
492467 gbc = new GridBagConstraints ();
493468 gbc .gridx = 6 ;
494469 gbc .gridy = 1 ;
@@ -515,8 +490,6 @@ public void replace(FilterBypass fb, int offset, int length, String text, Attrib
515490 gbc .fill = GridBagConstraints .HORIZONTAL ;
516491 statusDetailPanel .add (spacer2 , gbc );
517492
518- statusDetailPanel .setPreferredSize (new Dimension (350 , statusDetailPanel .getPreferredSize ().height ));
519-
520493 openButton .setVisible (false );
521494
522495 gbc = new GridBagConstraints ();
0 commit comments