GUI ile temel bir mvc deseni çalışıyorum. Bu kod JComboBox içerir. Jcombobox'ı tıklatıp buradan bir dize öğesi seçerken, boş etiket belirli bir dizeyi dolduracaktır. Denetleyici Sınıfımı nasıl yapmalıyım?mvc pattern gui actionlistener sınıfı
Bu benim Gui sınıf
public class SchoolView extends JPanel {
private JTextField selectedStandName;
private JComboBox<String> stands;
private JLabel standLabel;
String[] items = { "Rainbow Pots", "BookWorm's Place","Caffein Charger","Jedi's Place"};
public SchoolView() {
stands = new JComboBox<String>(items);
add(stands);
addStandLabel();
addStandInfoLabel();
addStandInfoField();
}
private void addStandLabel() {
standLabel = new JLabel("Stands");
add(standLabel);
}
private void addStandInfoLabel() {
JLabel selectedStandInfo = new JLabel("Stand Info");
add(selectedStandInfo);
}
private void addStandInfoField() {
SelectedStandName = new JTextField();
add(selectedStandName);
selectedStandName.setColumns(20);
}
}
olan bu Verilen benim denetleyicisi sınıf
public class SchoolController {
public SchoolController(){}
}