Results 1 to 4 of 4
- 01-23-2010, 02:14 PM #1
Member
- Join Date
- Sep 2009
- Location
- Gouda, the Netherlands
- Posts
- 24
- Rep Power
- 0
netbeans: changing an object from within an action
Hi,
In netbeans I created a form with a button and a text-area.
Now when I press the button I would like to do some calculations in the text-area.
This works so far that the calculations-code is invoked but the form is only refreshed after the button-action-method is finished.
I got a:
and from within:Java Code:private javax.swing.JTextArea output;
I call:Java Code:private void jButton1MouseClicked(java.awt.event.MouseEvent evt) { }
And only after jButton1MouseClicked is finished, this text is shown in the form.Java Code:output.append("some text");
How can I fix that? I tried to call repaint() after each output.append() but that didn't help.
-
You don't give enough information for anyone to know why you are having this problem. Perhaps you are tying up the EDT within your actionPerformed method, but without my crystal ball, I'm only guessing.
Luckily my magic 8 ball still works, and it says: look at using a SwingWorker object.
If this doesn't help, you may wish to provide more details and code, enough necessary to answer this question.
- 01-23-2010, 02:37 PM #3
Member
- Join Date
- Sep 2009
- Location
- Gouda, the Netherlands
- Posts
- 24
- Rep Power
- 0
-
Cool. I guess I'll have to hang on to that magic 8 ball!
Similar Threads
-
Operator < cannot be applied to java.lang.Object, Object
By Albert in forum Advanced JavaReplies: 2Last Post: 11-26-2010, 02:12 AM -
how to pass an arraylist from an object back to the parent object that it was created
By george_a in forum New To JavaReplies: 1Last Post: 03-04-2009, 06:14 PM -
Parsing a superclass object to subclass object dynamicly
By Andrefs in forum Advanced JavaReplies: 1Last Post: 07-22-2008, 04:27 PM -
[SOLVED] If a object equals another object, do they contain the same data?
By bobleny in forum New To JavaReplies: 1Last Post: 04-17-2008, 10:10 PM -
Creating object of Type Object class
By venkatv in forum New To JavaReplies: 3Last Post: 07-17-2007, 03:33 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks