From: Sam Takoy on
In my code (will provide an example if necessary), I have a JLabel that
doesn't change it's content after label.setText("new-content"). The text
does change after I resize the parent JInternalFrame. I have never
encountered this behavior before and I am wondering what this could be
caused by...

Thank you in advance,

Sam
From: Knute Johnson on
On 3/16/2010 8:14 AM, Sam Takoy wrote:
> In my code (will provide an example if necessary),

Always a good idea.

I have a JLabel that
> doesn't change it's content after label.setText("new-content"). The text
> does change after I resize the parent JInternalFrame. I have never
> encountered this behavior before and I am wondering what this could be
> caused by...

Are you calling setText() from the EDT?

Are you blocking the EDT?

--

Knute Johnson
email s/nospam/knute2010/

From: Tony Yan on
On 3/16/2010 12:08 PM, Knute Johnson wrote:
> On 3/16/2010 8:14 AM, Sam Takoy wrote:
>> In my code (will provide an example if necessary),
>
> Always a good idea.
>
> I have a JLabel that
>> doesn't change it's content after label.setText("new-content"). The text
>> does change after I resize the parent JInternalFrame. I have never
>> encountered this behavior before and I am wondering what this could be
>> caused by...
>
> Are you calling setText() from the EDT?
>
> Are you blocking the EDT?
>

Knute, what is EDT?

Tony
From: Daniel Pitts on
On 3/16/2010 8:14 AM, Sam Takoy wrote:
> In my code (will provide an example if necessary)
It is almost always necessary. Please provide an sscce <http://sscce.org/>

--
Daniel Pitts' Tech Blog: <http://virtualinfinity.net/wordpress/>
From: Arne Vajhøj on
On 16-03-2010 18:20, Tony Yan wrote:
> On 3/16/2010 12:08 PM, Knute Johnson wrote:
>> On 3/16/2010 8:14 AM, Sam Takoy wrote:
>>> In my code (will provide an example if necessary),
>>
>> Always a good idea.
>>
>> I have a JLabel that
>>> doesn't change it's content after label.setText("new-content"). The text
>>> does change after I resize the parent JInternalFrame. I have never
>>> encountered this behavior before and I am wondering what this could be
>>> caused by...
>>
>> Are you calling setText() from the EDT?
>>
>> Are you blocking the EDT?
>
> Knute, what is EDT?

http://en.wikipedia.org/wiki/Event_dispatching_thread

And EDT is something you should know about when programming GUI
in Java.

Arne