The moose likes Swing / AWT / SWT and the fly likes JFrames Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JFrames" Watch "JFrames" New topic


Yasser Shaikh

Joined: Oct 01, 2008
Posts: 21
How to play audio files on JFrames or JPanels.
How to play video files on JFrames or JPanels.
I am trying hard to figure it out.....but all my efforts are in vain..

So Experts please help.

pete stein

Joined: Feb 23, 2007
Posts: 1561
No expert in this, but if I were wanting to do this, I'd first spend a lot of time with Google. What has it told you so far? What avenues have you explored?

Good luck
Milan Agrawal

Joined: Sep 25, 2008
Posts: 8
Hello,me Milan,a new member to this site.

I think that you need to have link with the dll files to make a audio player.

otherwise you can also search in google for the code.

thank you.
Campbell Ritchie

Joined: Oct 13, 2005
Posts: 37962
And welcome to JavaRanch, Milan
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 41096
There are a number of libraries for playing back audio and video - JMF, QuickTime for Java, jVLC, ... The http://faq.javaranch.com/java/OtherOpenSourceProjectsFaq page links to those.

Simple audio playback can be done using the javax.sound package. See http://www.exampledepot.com/egs/javax.sound.sampled/pkg.html for examples.

In the future, please give your posts better subject lines - "JFrames" is rather misleading if you ask about audio/video playback.
[ October 04, 2008: Message edited by: Ulf Dittmer ]

Ping & DNS - my free Android networking tools app
Rob Spoor

Joined: Oct 27, 2005
Posts: 19651

JMF also has some support for user interfaces.

javax.media.Player has methods getControlPanelComponent and getVisualComponent for controlling and showing media files. I've been able to play a small movie in Java this way.

I do think that these controls are heavyweight controls, so mixing it with Swing (lightweight controls) may lead to some unexpected results.

How To Ask Questions How To Answer Questions
I agree. Here's the link: http://aspose.com/file-tools
subject: JFrames
Similar Threads
Drag And Drop a JPanel
background on Java Desktop Application
Looking at basic game design
How to disable or remove Close Button on JFrame
JScrollPane impossible to add....