Results 1 to 5 of 5
Thread: How can I loop sounds in JPanel?
- 04-24-2011, 08:29 AM #1
Member
- Join Date
- Nov 2010
- Posts
- 54
- Rep Power
- 0
- 04-24-2011, 08:38 AM #2
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,427
- Blog Entries
- 7
- Rep Power
- 17
Swing components have nothing to do with sound although there is a static method in the Applet class (you don't need to build an Applet) that can load an AudioClip for you; given that AudioClip you can play, loop or stop it. Don't implement that loading and playing logic in your JPanel itself; it takes away the distinction between controller logic and view (display) logic. As I wrote: visual components have nothing to do with sound (nor with database, nor with arrays, nothing, just displaying stuff).
kind regards,
JosWhen people rob a bank they get a penalty; when banks rob people they get a bonus.
- 04-24-2011, 02:51 PM #3
Member
- Join Date
- Nov 2010
- Posts
- 54
- Rep Power
- 0
oh but how do you load the music and when do i call the methods?
- 04-24-2011, 02:53 PM #4
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,427
- Blog Entries
- 7
- Rep Power
- 17
- 04-24-2011, 03:49 PM #5
Member
- Join Date
- Nov 2010
- Posts
- 54
- Rep Power
- 0
Similar Threads
-
playing sounds with the javax.sound package
By hannes in forum Advanced JavaReplies: 8Last Post: 05-27-2010, 06:45 PM -
Combining Individual Sounds - Urgent
By JDCAce in forum Advanced JavaReplies: 4Last Post: 12-05-2008, 05:17 AM -
Wave Sounds
By Doctor Cactus in forum New To JavaReplies: 2Last Post: 10-22-2008, 01:44 PM -
Turn off sounds in Eclipse
By gio.fou in forum EclipseReplies: 2Last Post: 09-06-2008, 08:31 PM -
Sounds don't play when running applet
By leonard in forum Java AppletsReplies: 1Last Post: 08-06-2007, 08:08 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks