• Post Reply Bookmark Topic Watch Topic
  • New Topic

Double Buffering?

 
Chris Copeland
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I recently posted this on the applet forum, but didn't receieve any response. Can someone help?
Hello all,
I have looked through a lot of complicated examples of double buffering and am getting completely confused. Here is all I need. I have an applet that is starting up a thread. The thread gets applet dimensions and staggers a y coordinate so that a message will scroll on the screen. It then calls repaint(). This kicks off an overridden paint method that includes: "g.drawString(scrollingMsg, x, y);"
This text is showing up. However, it is flickering on the screen as it moves across. How do I double buffer JUST the moving text without messing up the rest of the applet window where we are doing some payroll work?
Thanks,
Chris
 
Michael Ernest
High Plains Drifter
Sheriff
Posts: 7292
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hm. Well, you don't really want the extra burden of determining what region of the screen to clip and then refresh. The system will do this for you automatically. It's actually more work to control the precise location of repainting than it is to just let the system handle screen repair/updating for you.
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving this to the Swing / JFC / AWT forum...
 
Chris Copeland
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you give me a little more info behind that message? How can I let the system take care of it? I am completely new with the graphics class, and am very green in GUI programming. Basically all I know currently is what I have learned from looking at other's code.
Perhaps I am missing something.
Let me know...
thanks.
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Whoops... I answered you in the other post....

(Just another reason not to post multiple times...)
 
Chris Copeland
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks! I took your idea of defining a new component, and now it works GREAT!
Now if I could just get the layouts to work well, then I will be set!
Chris
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!