Closed GoogleCodeExporter closed 9 years ago
Ah, turns out I had the wrong reference to my Window (and this my TextArea). In
order to fix this issue, I called this:
getOwner().runInEventThread(new Action() {
@Override
public void doAction() {
TextArea act = (TextArea) getOwner().getActiveWindow().getComponentAt(2); //obviously this index varies, but I just counted it from which order I called addComponent()
textArea.insertLine(0, message);
getOwner().invalidate();
}
});
This gave me a correct reference to my TextArea. Anyway, the issue is resolved
now, please close this and file it under "noobie mistake"! Thanks for the great
framework :-)
Original comment by tobias.s...@gmail.com
on 11 Mar 2013 at 8:33
Okay... So you called invalidate() on the wrong Window? Or appendText("...") on
the wrong object?
Original comment by mab...@gmail.com
on 20 Mar 2013 at 1:23
Yeah exactly. My doAction in my button had a reference different from the one I
got when I called my own method. Obviously since doAction was able to update
the window and my method wasn't, I figured I somehow had to get the reference
to the window by other means that directly addressing it (I was using "this."
to refence to my window).
Long story short: I checked up on the ID's using the NetBeans debugger and
checked for consistency errors. And yes, as you said, I was calling
invalidate() on a wrong window - which to me (at first) didn't make sense,
because I was using "this.invalidate()". But it's just one of those things that
eludes new players like myself - reference consistency.
Sorrry about the wall of text. I'm struggling to understand the issue at hand
here and because of that, I'm not really sure how much information is relevant
to the case.
Thank you!
Original comment by tobias.s...@gmail.com
on 20 Mar 2013 at 2:35
All right, good to hear it worked out in the end.
Original comment by mab...@gmail.com
on 20 Apr 2013 at 8:47
Original issue reported on code.google.com by
tobias.s...@gmail.com
on 11 Mar 2013 at 7:26