• Post Reply Bookmark Topic Watch Topic
  • New Topic

two questions

 
M Nemonical
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.
 
Rene Liebmann
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.
 
Frank Hale
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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!