• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

two questions

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. I'm using a JDesktop... how can I set the window maximized? what's the method for that? And how can I align it to the center of screen.
2. I need to use a JProgressBar while the app connects to the database, but how can I use a progressbar without knowning the values? I dont know how much time the job will take...so there's no how I can set the values for progressbar, right?
Thanks in Advance.
F.
 
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
to your first question, there isn't a method, which will do that for you. You have to calculate it by your own. If you know the size of your JDesktopPane, then it should be easy for you to maximize your internal frame. Also centering should be easy.
To your second question, you are right. If you have to do only one connection to the database, then you can't know, which values to set to the progress. If you have different things to do, then you can calculate it somehow, but you will never detect the remaining time.
 
Ranch Hand
Posts: 230
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Assuming your app is extending JFrame you could try this function. Not sure if you want to center the JFrame or JInternalFrame....

Otherwise you could adapt it to your situation.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!