Explorar o código

this as global variable

dominik.rieder %!s(int64=8) %!d(string=hai) anos
pai
achega
e0abfee97b
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      src/ui/view/StatisticGraphPanel.java

+ 2 - 1
src/ui/view/StatisticGraphPanel.java

@@ -30,6 +30,7 @@ public class StatisticGraphPanel extends JPanel {
 	private final JLabel maximumLabel = new JLabel("0");
 	private JPanel topPanel = new JPanel();
 	private JButton closeButton = new JButton("X");
+	private JPanel that;
 
 	// Variables
 	String graphName;
@@ -68,7 +69,7 @@ public class StatisticGraphPanel extends JPanel {
 		maximumLabel.setPreferredSize(new Dimension(30,10));
 		// ******************** Component Listener ****************//
 		
-		JPanel that = this;
+		that = this;
 		closeButton.addActionListener(new ActionListener() {
 			@Override
 			public void actionPerformed(ActionEvent e) {