Okay, I’m trying to make a mission editor.
And I can’t get this extremely easy task to work. I don’t understand why.
A Mission, has tasks, tasks have dialogs.
Now I open the new tasks window and want to add a Dialog. Which I do by pressing a button.
The Frame opens and I choose whos speaking and the type in the dialog.
I then click finish.
This fires this method:
@Action
public void addDialog() {
newAufgabe na = new newAufgabe();
na.addDialog(txtText.getText(),cbWho.getSelectedItem()+"");
this.setVisible(false);
}
And then back in the tasks frame this method is fired.
public void addDialog(String Text, String Who) {
dialogs.add(new Dialog(Who,Text));
listdata = new String[dialogs.size()];
for (int i=0; i<listdata.length; i++){
listdata[i] = dialogs.get(i).getWho();
}
lblTest.setText(listdata[0]); // this also doesn't do anything. Eventough it should change the Label. The Label doesn't change
listDialog.setListData(listdata);
}
Now normally the jlist should be updated. But it seems like java completely ignores the fact that this method exists.
I debugged it and it went though the whole process, it seems to be working just fine. It adds the dialog to the arraylist. it goes into the for-loop. and does what it does.
But the frame does not update not single bit. I hate guis. Or maybe this is just some netbeans related stuff. I’m always having weird simple problems with java in guis.