jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1835363 - /jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/gui/ProxyControlGui.java
Date Sun, 08 Jul 2018 16:06:42 GMT
Author: pmouawad
Date: Sun Jul  8 16:06:42 2018
New Revision: 1835363

URL: http://svn.apache.org/viewvc?rev=1835363&view=rev
Log:
Bug 62212 : Recorder : Improve UX by providing a popup above all windows to be able to change
Transaction names and pauses while using Browser 

Fix NPE if user closes the intermediate dialog that automatically disappears after 7 seconds
Bugzilla Id: 62212

Modified:
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/gui/ProxyControlGui.java

Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/gui/ProxyControlGui.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/gui/ProxyControlGui.java?rev=1835363&r1=1835362&r2=1835363&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/gui/ProxyControlGui.java
(original)
+++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/gui/ProxyControlGui.java
Sun Jul  8 16:06:42 2018
@@ -25,6 +25,7 @@ import java.awt.Dimension;
 import java.awt.GridBagConstraints;
 import java.awt.GridBagLayout;
 import java.awt.HeadlessException;
+import java.awt.Window;
 import java.awt.datatransfer.DataFlavor;
 import java.awt.datatransfer.UnsupportedFlavorException;
 import java.awt.event.ActionEvent;
@@ -613,7 +614,13 @@ public class ProxyControlGui extends Log
 
                 // Make dialog disappear after 7 seconds
                 JLabel messageLabel = new JLabel(sb.toString());
-                Timer timer = new Timer(7000, evt -> SwingUtilities.getWindowAncestor(messageLabel).dispose());
+                Timer timer = new Timer(7000, evt -> {
+                    Window window = SwingUtilities.getWindowAncestor(messageLabel);
+                    // Window may be closed by user
+                    if(window != null) {
+                        window.dispose();
+                    }
+                });
                 timer.setRepeats(false);
                 timer.start();
                 JOptionPane.showMessageDialog(this,



Mime
View raw message