java - Trying to change title of JFrame from a Thread? -


When I'm trying to set the title of my function to a thread, then I will say my JF: / P> Public Zero Setitude (String Nutital) {this.setTitle (newTitle); }

In my thread, I try to use the function by doing this:

  Main.settail (schar1 + schar2 + "-Restation- "+ Schar3 + bhara 4);  

(main is the name of my class, and schar1, shcar2, schar3, and schar4 variables that are first shown in the thread)

When I do this , It says that I can not create a static reference for non-static method (strings) from type frames, so I changed the function to:

  Public static zero set theTitle ( String NewTel) {this.setTitle (newTitle); }  

And it now gives me an error that I can not use it in a constant context. Can anyone tell me how to fix this?

This is my best bet - - Try setting GeFrom instead of expanding it < / P>

  Private JFrame jf = New JFram ("First Title");  

and access the title from that method

  jf.setTitle (newTitle);  

Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -