• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

1st question with app

 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi I'm diggin' into the search to find a complete answer for this.

I'm building an app with 4 different windows:

1.- Logon Window
2.- Select window.
3.- Data work window.
4.- Bye window.

Actually everyone is an extension of a JFrame, I create and set visible the new window and dispose the old one. Looks good untill I create the Data working window that doesn't display a progress bar (I imagine the task occupies all cpu time and it can't paint the progress bar).

Is this the correct way to structure the window changing. Is there a way to show my progress bar before the method that does the har work starts?
 
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
carlos,

I think this is because both the 'hard work' bit and the progress bar are both running in the same thread. If you create a new thread to run the hard work processing bit then the GUI (i.e. progress bar) should update itself concurrently...I think
 
Ranch Hand
Posts: 1535
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
 
carlos sanchez
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yup, problem is with threads.
I've wallked around using the java tutorial example with using the Progress Monitor dialog box. Just if someone is interested it uses a timer to check the task that's performing the operation and checks it's state.

Just as the one you've sent Craig, thank U.
 
reply
    Bookmark Topic Watch Topic
  • New Topic