import javax.swing.JLabel; public class LabelTown { private String s = "Домашнее время"; JLabel l1 = new JLabel(s); public void setS(String k){ s = k; l1.setText(s); } }