package ru.nsu.ccfit.bogush.view;

import javax.swing.*;

public class LabeledValue extends JPanel {
	private JLabel valueLabel;
	private JLabel label;
	private JPanel panel;

	public LabeledValue(String labelText) {
		label.setText(labelText);
		label.addPropertyChangeListener(evt -> {
			if ("label".equals(evt.getPropertyName())) {
				label.setText((String) evt.getNewValue());
			}
		});
	}

	public synchronized void setEnabled(boolean enabled) {
		valueLabel.setEnabled(enabled);
	}

	public synchronized void setValue(int value) {
		setText(String.valueOf(value));
	}

	public synchronized void setText(String text) {
		valueLabel.setText(text);
	}

	public String getText() {
		return valueLabel.getText();
	}
}

@@ -169,16 +169,37 @@
 panel;%0A%0A
+%09private int value;%0A%0A
 %09public 
@@ -264,180 +264,18 @@
 );%0A%09
-%09label.addPropertyChangeListener(evt -%3E %7B%0A%09%09%09if (%22label%22.equals(evt.getPropertyName())) %7B%0A%09%09%09%09label.setText((String) evt.getNewValue());%0A%09%09%09%7D%0A%09%09%7D);%0A%09%7D%0A%0A%09public synchronized
+%7D%0A%0A%09public
  voi
@@ -394,16 +394,49 @@
 ue) %7B%0A%09%09
+this.value = value;%0A%09%09valueLabel.
 setText(
@@ -488,90 +488,20 @@
 zed 
-void setText(String text) %7B%0A%09%09valueLabel.setText(text);%0A%09%7D%0A%0A%09public String getText
+int getValue
 () %7B
@@ -519,23 +519,8 @@
 alue
-Label.getText()
 ;%0A%09%7D

Make getter and setter of the value field synchronized