Code:
wochenTag1 = new Label(daten.tagName[0]);
wochenTag1.setFont (new Font("ARIAL", 3,16));
wochenTag1.setForeground(Color.BLACK);
wochenTage.add(wochenTag1);
wochenTag2 = new Label(daten.tagName[1]);
wochenTag2.setFont (new Font("ARIAL", 3,16));
wochenTag2.setForeground(Color.BLACK);
wochenTage.add(wochenTag2);
wochenTag3 = new Label(daten.tagName[2]);
wochenTag3.setFont (new Font("ARIAL", 3,16));
wochenTag3.setForeground(Color.BLACK);
wochenTage.add(wochenTag3);
wochenTag4 = new Label(daten.tagName[3]);
wochenTag4.setFont (new Font("ARIAL", 3,16));
wochenTag4.setForeground(Color.BLACK);
wochenTage.add(wochenTag4);
wochenTag5 = new Label(daten.tagName[4]);
wochenTag5.setFont (new Font("ARIAL", 3,16));
wochenTag5.setForeground(Color.BLACK);
wochenTage.add(wochenTag5);
wochenTag6 = new Label(daten.tagName[5]);
wochenTag6.setFont (new Font("ARIAL", 3,16));
wochenTag6.setForeground(Color.BLACK);
wochenTage.add(wochenTag6);
wochenTag7 = new Label(daten.tagName[6]);
wochenTag7.setFont (new Font("ARIAL", 3,16));
wochenTag7.setForeground(Color.BLACK);
wochenTage.add(wochenTag7);
// public void actionPerformed:
else if(wert == "<<"){
daten.setMonat(daten.getMonat() -1);
mNameLabel.setText(daten.nameMonat);
daten.setWochenTag(daten.wochentage(daten.cal.get(daten.cal.DAY_OF_WEEK)));
wochenTag1.setText(daten.tagName[0]);
wochenTag1.setFont (new Font("ARIAL", 3,16));
wochenTag1.setForeground(Color.BLACK);
wochenTag2.setText(daten.tagName[1]);
wochenTag2.setFont (new Font("ARIAL", 3,16));
wochenTag2.setForeground(Color.BLACK);
wochenTag3.setText(daten.tagName[2]);
wochenTag3.setFont (new Font("ARIAL", 3,16));
wochenTag3.setForeground(Color.BLACK);
wochenTag4.setText(daten.tagName[3]);
wochenTag4.setFont (new Font("ARIAL", 3,16));
wochenTag4.setForeground(Color.BLACK);
wochenTag5.setText(daten.tagName[4]);
wochenTag5.setFont (new Font("ARIAL", 3,16));
wochenTag5.setForeground(Color.BLACK);
wochenTag6.setText(daten.tagName[5]);
wochenTag6.setFont (new Font("ARIAL", 3,16));
wochenTag6.setForeground(Color.BLACK);
wochenTag7.setText(daten.tagName[6]);
wochenTag7.setFont (new Font("ARIAL", 3,16));
wochenTag7.setForeground(Color.BLACK);
}
else if (wert == ">>"){
daten.setMonat(daten.getMonat() +1);
mNameLabel.setText(daten.nameMonat);
daten.setWochenTag(daten.wochentage(daten.cal.get(daten.cal.DAY_OF_WEEK)));
wochenTag1.setText(daten.tagName[0]);
wochenTag1.setFont (new Font("ARIAL", 3,16));
wochenTag1.setForeground(Color.BLACK);
wochenTag2.setText(daten.tagName[1]);
wochenTag2.setFont (new Font("ARIAL", 3,16));
wochenTag2.setForeground(Color.BLACK);
wochenTag3.setText(daten.tagName[2]);
wochenTag3.setFont (new Font("ARIAL", 3,16));
wochenTag3.setForeground(Color.BLACK);
wochenTag4.setText(daten.tagName[3]);
wochenTag4.setFont (new Font("ARIAL", 3,16));
wochenTag4.setForeground(Color.BLACK);
wochenTag5.setText(daten.tagName[4]);
wochenTag5.setFont (new Font("ARIAL", 3,16));
wochenTag5.setForeground(Color.BLACK);
wochenTag6.setText(daten.tagName[5]);
wochenTag6.setFont (new Font("ARIAL", 3,16));
wochenTag6.setForeground(Color.BLACK);
wochenTag7.setText(daten.tagName[6]);
wochenTag7.setFont (new Font("ARIAL", 3,16));
wochenTag7.setForeground(Color.BLACK);
kann man das auch kürzer schreiben?