5454 */
5555public class NewVersionPopup extends JDialog {
5656 /** whether to keep displaying this dialog, and for which releases */
57- private JComboBox <String > _modeBox ;
57+ private final JComboBox <String > _modeBox ;
5858 /** the button that closes this window */
59- private JButton _closeButton ;
59+ private final JButton _closeButton ;
6060 /** the button that updates to the new version */
61- private JButton _updateButton ;
61+ private final JButton _updateButton ;
6262 /** the button that downloads the new version */
63- private JButton _downloadButton ;
63+ private final JButton _downloadButton ;
6464 /** the parent frame */
65- private MainFrame _mainFrame ;
65+ private final MainFrame _mainFrame ;
6666 /** the version information pane */
67- private JOptionPane _versionPanel ;
67+ private volatile JOptionPane _versionPanel ;
6868 /** the panel with the buttons and combobox */
69- private JPanel _bottomPanel ;
69+ private final JPanel _bottomPanel ;
7070 /** the build time of this version */
71- private static Date BUILD_TIME = Version .getBuildTime ();
71+ private static final Date BUILD_TIME = Version .getBuildTime ();
7272 /** the message for the user */
73- private String [] _msg = null ;
73+ private volatile String [] _msg = null ;
7474 /** the version string of the new version found, or "" */
75- private String _newestVersionString = "" ;
75+ private volatile String _newestVersionString = "" ;
7676 /** indeterminate progress bar */
7777
7878 /** Creates a window to display whether a new version of DrJava is available.
@@ -110,13 +110,13 @@ public void actionPerformed(ActionEvent e) {
110110 _downloadButton .setEnabled (false );
111111
112112 _bottomPanel = new JPanel (new BorderLayout ());
113- JPanel buttonPanel = new JPanel ();
113+ final JPanel buttonPanel = new JPanel ();
114114 buttonPanel .setLayout (new BoxLayout (buttonPanel , BoxLayout .Y_AXIS ));
115115 buttonPanel .add (_updateButton );
116116 buttonPanel .add (_downloadButton );
117117 buttonPanel .add (_closeButton );
118118 _bottomPanel .add (buttonPanel , BorderLayout .CENTER );
119- JPanel comboPanel = new JPanel ();
119+ final JPanel comboPanel = new JPanel ();
120120 comboPanel .add (new JLabel ("Check for: " ));
121121 comboPanel .add (_modeBox );
122122 _bottomPanel .add (comboPanel , BorderLayout .WEST );
@@ -130,7 +130,7 @@ private void updateText() {
130130 JOptionPane .DEFAULT_OPTION ,null ,
131131 new Object [0 ]);
132132
133- JPanel cp = new JPanel (new BorderLayout (5 ,5 ));
133+ final JPanel cp = new JPanel (new BorderLayout (5 ,5 ));
134134 cp .setBorder (new EmptyBorder (5 ,5 ,5 ,5 ));
135135 setContentPane (cp );
136136 cp .add (_versionPanel , BorderLayout .CENTER );
@@ -146,7 +146,7 @@ private void updateText() {
146146 _versionPanel = new JOptionPane (msg ,JOptionPane .INFORMATION_MESSAGE ,
147147 JOptionPane .DEFAULT_OPTION ,null ,
148148 new Object [0 ]);
149- JPanel cp = new JPanel (new BorderLayout (5 ,5 ));
149+ final JPanel cp = new JPanel (new BorderLayout (5 ,5 ));
150150 cp .setBorder (new EmptyBorder (5 ,5 ,5 ,5 ));
151151 setContentPane (cp );
152152 cp .add (_versionPanel , BorderLayout .CENTER );
@@ -235,13 +235,13 @@ protected void abortUpdate(String message, boolean close) {
235235 }
236236
237237 protected void updateAction () {
238- JPanel cp = new JPanel (new BorderLayout (5 ,5 ));
238+ final JPanel cp = new JPanel (new BorderLayout (5 ,5 ));
239239 cp .setBorder (new EmptyBorder (5 ,5 ,5 ,5 ));
240240 setContentPane (cp );
241241 cp .add (new JOptionPane ("Waiting for www.sourceforge.net ..." ,JOptionPane .INFORMATION_MESSAGE ,
242242 JOptionPane .DEFAULT_OPTION ,null ,
243243 new Object [0 ]), BorderLayout .CENTER );
244- JProgressBar pb = new JProgressBar (0 ,100 );
244+ final JProgressBar pb = new JProgressBar (0 ,100 );
245245 pb .setIndeterminate (true );
246246 cp .add (pb , BorderLayout .SOUTH );
247247 validate ();
0 commit comments