@@ -64,17 +64,17 @@ public final class MainWindow implements Runnable, RipStatusHandler {
6464
6565 private static JLabel statusLabel ;
6666 private static final ProgressTextField currentlyRippingProgress = new ProgressTextField ();
67- private static final JLabel pendingValue = new JLabel ( "0" );
67+ private static final JLabel pendingValue = new MinimumWidthLabel ( "1000" , "0" );
6868 private static final JLabel pendingLabel = new JLabel ("Pending" );
69- private static final JLabel activeValue = new JLabel ( "0" );
69+ private static final JLabel activeValue = new MinimumWidthLabel ( "1000" , "0" );
7070 private static final JLabel activeLabel = new JLabel ("Active" );
71- private static final JLabel completedValue = new JLabel ( "0" );
71+ private static final JLabel completedValue = new MinimumWidthLabel ( "1000" , "0" );
7272 private static final JLabel completedLabel = new JLabel ("Completed" );
73- private static final JLabel erroredValue = new JLabel ( "0" );
73+ private static final JLabel erroredValue = new MinimumWidthLabel ( "1000" , "0" );
7474 private static final JLabel erroredLabel = new JLabel ("Errored" );
75- private static final JLabel totalValue = new JLabel ( "0" );
75+ private static final JLabel totalValue = new MinimumWidthLabel ( "1000" , "0" );
7676 private static final JLabel totalLabel = new JLabel ("Total" );
77- private static final JLabel transferRateValue = new JLabel ( "0.00 B/s" );
77+ private static final JLabel transferRateValue = new MinimumWidthLabel ( "999.00 KiB/s" , "0.00 B/s" );
7878 private static final JLabel transferRateLabel = new JLabel ("Speed" );
7979 private static final JButton openButton = new JButton ();
8080
@@ -405,10 +405,6 @@ public void replace(FilterBypass fb, int offset, int length, String text, Attrib
405405 pendingValue .setFont (monospaced );
406406 pendingValue .setHorizontalAlignment (JLabel .TRAILING );
407407 pendingValue .setBorder (valueLabelBorder );
408- pendingValue .setText ("1000" );
409- pendingValue .setPreferredSize (pendingValue .getPreferredSize ());
410- pendingValue .setMinimumSize (pendingValue .getPreferredSize ());
411- pendingValue .setText ("0" );
412408 gbc = new GridBagConstraints ();
413409 gbc .gridx = 0 ;
414410 gbc .gridy = 0 ;
@@ -422,10 +418,6 @@ public void replace(FilterBypass fb, int offset, int length, String text, Attrib
422418 activeValue .setFont (monospaced );
423419 activeValue .setHorizontalAlignment (JLabel .TRAILING );
424420 activeValue .setBorder (valueLabelBorder );
425- activeValue .setText ("1000" );
426- activeValue .setPreferredSize (activeValue .getPreferredSize ());
427- activeValue .setMinimumSize (activeValue .getPreferredSize ());
428- activeValue .setText ("0" );
429421 gbc = new GridBagConstraints ();
430422 gbc .gridx = 0 ;
431423 gbc .gridy = 1 ;
@@ -439,10 +431,6 @@ public void replace(FilterBypass fb, int offset, int length, String text, Attrib
439431 completedValue .setFont (monospaced );
440432 completedValue .setHorizontalAlignment (JLabel .TRAILING );
441433 completedValue .setBorder (valueLabelBorder );
442- completedValue .setText ("1000" );
443- completedValue .setPreferredSize (completedValue .getPreferredSize ());
444- completedValue .setMinimumSize (completedValue .getPreferredSize ());
445- completedValue .setText ("0" );
446434 gbc = new GridBagConstraints ();
447435 gbc .gridx = 3 ;
448436 gbc .gridy = 0 ;
@@ -456,10 +444,6 @@ public void replace(FilterBypass fb, int offset, int length, String text, Attrib
456444 erroredValue .setFont (monospaced );
457445 erroredValue .setHorizontalAlignment (JLabel .TRAILING );
458446 erroredValue .setBorder (valueLabelBorder );
459- erroredValue .setText ("1000" );
460- erroredValue .setPreferredSize (erroredValue .getPreferredSize ());
461- erroredValue .setMinimumSize (erroredValue .getPreferredSize ());
462- erroredValue .setText ("0" );
463447 gbc = new GridBagConstraints ();
464448 gbc .gridx = 3 ;
465449 gbc .gridy = 1 ;
@@ -473,10 +457,6 @@ public void replace(FilterBypass fb, int offset, int length, String text, Attrib
473457 totalValue .setFont (monospaced );
474458 totalValue .setHorizontalAlignment (JLabel .TRAILING );
475459 totalValue .setBorder (valueLabelBorder );
476- totalValue .setText ("1000" );
477- totalValue .setPreferredSize (totalValue .getPreferredSize ());
478- totalValue .setMinimumSize (totalValue .getPreferredSize ());
479- totalValue .setText ("0" );
480460 gbc = new GridBagConstraints ();
481461 gbc .gridx = 6 ;
482462 gbc .gridy = 0 ;
@@ -490,11 +470,6 @@ public void replace(FilterBypass fb, int offset, int length, String text, Attrib
490470 transferRateValue .setFont (monospaced );
491471 transferRateValue .setHorizontalAlignment (JLabel .TRAILING );
492472 transferRateValue .setBorder (valueLabelBorder );
493- transferRateValue .setText ("999.00 KiB/s" ); // Maximum width value
494- // Set preferred size to maximum width value
495- transferRateValue .setPreferredSize (transferRateValue .getPreferredSize ());
496- transferRateValue .setMinimumSize (transferRateValue .getPreferredSize ());
497- transferRateValue .setText ("0 B/s" ); // Restore default value
498473 gbc = new GridBagConstraints ();
499474 gbc .gridx = 6 ;
500475 gbc .gridy = 1 ;
@@ -521,8 +496,6 @@ public void replace(FilterBypass fb, int offset, int length, String text, Attrib
521496 gbc .fill = GridBagConstraints .HORIZONTAL ;
522497 statusDetailPanel .add (spacer2 , gbc );
523498
524- statusDetailPanel .setPreferredSize (new Dimension (350 , statusDetailPanel .getPreferredSize ().height ));
525-
526499 openButton .setVisible (false );
527500
528501 gbc = new GridBagConstraints ();
0 commit comments