Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JProgressBar spacing

 
Piotr Nowicki
Ranch Hand
Posts: 611
1
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Howdy Ranchers!

First of all - gotta say that I really hate the GUI part of this task... Locking, business logic and networking was a pleasure. GUI is a hell... But, no groaning.

I've got a problem with creating a spacing for my progress bar. I really don't like as it is "glued" to the window borders by default.

This is a piece of code I use:



And in the attachment you can see what I get... Needles to say - it's not what was expected.

Every help would be very appreciated :-)

Or perhaps someone know if they added an indeterminate ProgressMonitor to the API or someone used something similar?

Cheers!
Screenshot.png
[Thumbnail for Screenshot.png]
 
pete stein
Bartender
Posts: 1561
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How about placing the JProgressBar BorderLayout.CENTER into a JPanel that uses BorderLayout and that has the desired empty border. Then add this same JPanel into your content JPanel, again BorderLayout.CENTER. Often it's simply a matter of nesting the right components.
 
Piotr Nowicki
Ranch Hand
Posts: 611
1
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Brilliant Pete! Thanks a lot - it worked out!
 
pete stein
Bartender
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Pedro Kowalski wrote:Brilliant Pete! Thanks a lot - it worked out!


Glad you've got it working.

Good luck with the rest of the project!
 
Piotr Nowicki
Ranch Hand
Posts: 611
1
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot mate! :-)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic