From: Sam Takoy on 16 Mar 2010 11:14 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 16 Mar 2010 12:08 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 16 Mar 2010 18:20 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 16 Mar 2010 18:33 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 16 Mar 2010 18:42 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
|
Next
|
Last
Pages: 1 2 3 4 5 Prev: "this" pointer in a sublcass Next: Parse and find charater in a stream containing \x ... |