Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Other Java > Java GUI
|
Java GUI Discussions specific to programming Java GUI.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Java GUI section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 26th, 2009, 02:19 PM
Registered User
 
Join Date: Aug 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default JSlider for music player

Hello,

I am implementing a player in Java for wave files. I have stop, pause, play, button etc.
In addition, I have a JSlider that I would want to indicate the location in the song is played.

Something like this obviously needs like a constant event that will trigger the update.

I tried writing:
for(int i=jSlider.getMinimum(); i<=jSlider.getMaximum;){
int val = calc_point_for_slider(song, jSlider);
jSlider.setValue(val);
Thread.sleep(1000);

But it just "jams" the computer for the duration of the for-loop and only after the last iteration, the slider's button "jumps" from the begining to the start (without slowly progressing).
}


If you could help me, I'd be very greatful.
Thank you.





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to playing music in C#? Viet Hoang C# 2005 4 June 13th, 2006 03:51 AM
How create a flash music player method Flash (all versions) 1 July 25th, 2005 12:01 PM
Playing music in C# Fightfish C# 0 June 26th, 2005 08:09 AM
Where is the Music Store? DRACULA Java Databases 4 September 23rd, 2004 12:15 AM
Music catalogue blabla1 PHP How-To 1 July 27th, 2004 01:19 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.