java - Why does the second JFrame does not show components? -


I already have jehfram and it works fine when I press a button, it shows a JPP , But I get empty jaffram I open it with

  p = new progress ("1/3"); P.setMax (2); P.setprogress (0, "Receiving Bytes ...");  

Why do anyone know?

Edit: I'm going to explain in more detail (because someone wrongly misinterpreted my post and corrected my post) - in my main class I start the first jfram: new crypt (); and in the crypt class I have registered a button action killer onClick it opens a second geometric but it is empty :

  p = new progress ( "1/3"); P.setMax (2); P.setprogress (0, "Receiving Bytes ...");  

I have registered in the crypt class One Button ActionList OnClick This opens a second GeFram but it is empty

Runs the swing listener on the applicable code Event Dispatch Thread (ADT) . ADT is responsible for the painting of swing components. Since your code is executing a long-running function on ADT Y9, so as long as the work is finished, the swing is being stopped by painting the components.

You need to start a separate thread for your long-lasting work. Or better yet you should use a swing worker to read the section from the swing tutorial on which it has more details and provides an example of a swing worker.


Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -