• Post Reply Bookmark Topic Watch Topic
  • New Topic

Strange behavior of scrollbars  RSS feed

 
Tina Boettger
Greenhorn
Posts: 15
Eclipse IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello again

Thank you for your great help in the past. Today I come with a new problem.
The last time I asked for some help to draw axis to a graph. Also had problems
with the layout. But that is all resolved thanks to your solutions.
My problem now is:
When the graph is scrolled with two scrollbars, the axis move along (they are in
a different panel and added as listeners to the scrollbar). Now the problem is,
the scrollbar gets drawn on the axis (the same that happens when your system
freezes and you drag a window around then dozens of copies get drawn on
the background.)
Do you have any idea what could help? Maybe I should update the axis position
less often?
I added the main class and a reduced axis class.
I also added a picture of the error. When I draw another window over it, or
minimize/maximize the window it disappears...

Thank you for your time and help!
fehler.PNG
[Thumbnail for fehler.PNG]
What happens when the scrollbars are moved
 
Darryl Burke
Bartender
Posts: 5167
11
Java Netbeans IDE Opera
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You missed the call to the super implementation at the top of the paintComponent(...) override.

More here.

edit Also, remove the setOpaque(true). (1) Never change the state of a Component in a painting method override and (2) It isn't required
 
Tina Boettger
Greenhorn
Posts: 15
Eclipse IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Darryl!
Thank you very much, I can't believe it
You are a miracle thanks again

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!