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:
1 2 3 4 5 6
| @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.
1 2 3 4 5 6 7 8 9 10 11 12 13
| 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]); 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.