This week's book giveaway is in the Cloud/Virtualizaton forum.
We're giving away four copies of Mesos in Action and have Roger Ignazio on-line!
See this thread for details.
Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Skinnable ProgressBar and resize mechanism

 
Arnon Eilat
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm new here...

I'm building a small skinnable program.

I know I can use the setLookAndFeel() method,
but i want full control over the look of my Components.
For this reason i override the paint method' and paint the Components with images or GradientPaint.

Here is my Skinnable ProgressBar.
Of course, the original code is more complicated, specially the paint method.
To make the code more readable and simple i remove some unnecessary part (more MouseListener, Graphics stuff etc...)

The Problem:
I don't succeed to make the resize() method of the SkinnableProgressBar class work Appropriately,
Which means to make that the indicatorRect Height's will Changes in proportion to the General High.
Can anyone show my how the resize mechanism should work ?

btw
I know that during the resize the ProgressBar jump, but this is not the problem - it's happens because i remove some parts of the code...

tnx


 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
perhaps you could add more detail of exactly what should happen when the frame resizes

I tried the code, if I drag the frame bottom lower, the progressbar(?) increases in height
(that's the one on the right, not where it jumps to the left)
 
Arnon Eilat
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the problem is that the indicatorRect(the blue one) is disappear when the frame resize.
the indicatorRect should keep it proportion relative to the size of the frame.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic