Jump to content

  • Log In with Google      Sign In   
  • Create Account

[java] jsrollpanel


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 Benzy54   Members   -  Reputation: 122

Like
Likes
Like

Posted 04 June 2001 - 01:21 PM

I have a frame with a jscrollpanel. The scrollpanel''s child is a panel with lines drawn on it. When it runs and i scroll down or sideways the lines become distorted and won''t get better until i resize the window. I know i could repaint. But what about image buffering. Could someone explain it to me.

Sponsor:

#2 eboz   Members   -  Reputation: 122

Like
Likes
Like

Posted 07 June 2001 - 09:19 AM

I''m not sure what you are trying to do here. It sounds like you are trying to scroll through a map, and you are rendering the entire map every frame. If so, that''s not really the best way to go about things. Look at some articles on the web dealing with Tile Engines. You should only Render what the user can see at once, and often not even that much (the dirty rectangle theory).

As for double buffering, I was of the thought that the Swing Library already took care of that. Repaint seems to be your only answer in this case.


Eboz

#3 buh   Members   -  Reputation: 122

Like
Likes
Like

Posted 08 June 2001 - 03:26 PM

Well, you could try setDoubleBuffered(true). Also try all three viewport scroll modes to see which one works best. SIMPLE_SCROLL_MODE, BLIT_SCROLL_MODE or BACKINGSTORE_SCROLL_MODE. Use getViewport.setScrollMode() for that. I think BLIT will be the best. Not sure. Hope that helps


#4 Jim_Ross   Members   -  Reputation: 122

Like
Likes
Like

Posted 12 June 2001 - 08:02 AM

Sounds like there''s a problem with mixing lightweight and heavyweight components. Try making everything a JComponent subclass; Frame -> JFrame, Panel -> JPanel. That could be the only cause of your image corruption.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS