# Can anyone help me stop my Java applet from flickering? (and other Java questions)

**URL:** <https://boards.straightdope.com/t/can-anyone-help-me-stop-my-java-applet-from-flickering-and-other-java-questions/424756>\
**Category:** Factual Questions\
**Created:** [October 31, 2007, 6:43pm UTC](https://boards.straightdope.com/t/can-anyone-help-me-stop-my-java-applet-from-flickering-and-other-java-questions/424756 "2007-10-31T18:43:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dgrdfd](https://avatars.discourse-cdn.com/v4/letter/d/eb8c5e/32.png) [@dgrdfd](https://boards.straightdope.com/u/dgrdfd)\
**Post date:** [October 31, 2007, 6:43pm UTC](https://boards.straightdope.com/t/can-anyone-help-me-stop-my-java-applet-from-flickering-and-other-java-questions/424756/1 "2007-10-31T18:43:40Z")

</div>

This is really my first attempt at making a Java applet. I am trying to create an MP3 player sort of thing. I have heard of, but don’t quite understand the double buffering technique (painting to a temp image and then painting that image to the user). I copied an example from another page that used double buffering, but it still flickers a lot.

The basic way I am creating this applet is by making a GUI layout in Gimp and painting that as the background. Then I am placing various components over this. The picture at the very top will be some kind of title image. The Coldplay image on the left will be the CD image of the song currently playing.

If anyone has any other advice I would really appreciate it. This is really the first “advanced” Java GUI I have ever made (besides using the normal buttons and other widgets that Java natively provides).

Also if anyone has any advice for playing MP3’s or audio (besides simple .au audio clips) I would be incredibly grateful. I was really hoping I could find something simple like a class where I could pass to the constructor the name and location of an MP3 file and then say object.play() or object.pause() but I haven’t been able to find anything this simple. Any ideas?  
Here’s my source code and pictures.  
[http://rapidshare.com/files/66547758/Applet.rar.html](http://rapidshare.com/files/66547758/Applet.rar.html)  
Thanks guys!

---

<div class="post-metadata">

**Author:** ![ZipperJJ](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/zipperjj/32/211_2.png) [@ZipperJJ](https://boards.straightdope.com/u/ZipperJJ)\
**Post date:** [October 31, 2007, 7:23pm UTC](https://boards.straightdope.com/t/can-anyone-help-me-stop-my-java-applet-from-flickering-and-other-java-questions/424756/2 "2007-10-31T19:23:11Z")

</div>

No answers about Java but I’ve had much luck doing it in Flash (well, setting up someone else’s Flash-based MP3 player) and of course there’s tons of ways for doing it with Windows Media Player - but of course that assumes your user has WMP (which is a bad thing to assume).

Other than that…sorry, got nothin’.
