-
Class not being called
Both the classes are in the same folder. But it was unable to call the class 'Player'. The player class contains latest media player that can even run video files from the network. Can u please help me out.
Here is the application.
import java.io.*;
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import de.humatic.dsj.*;
public class Movie implements ActionListener
{
JButton b;
JPanel pane;
public Component createComp()
{
pane = new JPanel();
b = new JButton("Media Player");
pane.add(b);
b.addActionListener(this);
return pane;
}
public void actionPerformed(ActionEvent ae)
{
Player p = new Player();
}
public static void main(String agrs[])
{
JFrame.setDefaultLookAndFeelDecorated(true);
JFrame frame = new JFrame("Media Player");
Movie m = new Movie();
Component comp = m.createComp();
frame.getContentPane().add(comp);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.pack();
frame.setSize(800,600);
frame.setVisible(true);
}
};
Here iam giving Player.java also
import java.io.*;
import de.humatic.dsj.*;
import javax.swing.*;
public class Player
{
public static void main(String args[])throws Exception
{
String path = "http://localhost:8080/seattle.wmv";
DSMovie ds = new DSMovie(path);
JFrame.setDefaultLookAndFeelDecorated(true);
JFrame f = new JFrame("Media Player");
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.getContentPane().add(ds);
f.pack();
f.setVisible(true);
}
};
subhakar
-
Are they in the same package?
-
Yes ofcourse both the classes are in the same package.
subhakar
-
It's more complex than simply being in the same directory. Neither of these classes declare what package they are in. You should take a look at package declaration and classpath to make sure the JVM knows how to find the class you want.
Similar Threads
-
Replies: 5
Last Post: 01-15-2006, 07:10 PM
-
Replies: 0
Last Post: 01-14-2006, 07:01 PM
-
By none_none in forum Java
Replies: 17
Last Post: 04-28-2005, 03:00 PM
-
Replies: 5
Last Post: 10-17-2002, 01:58 PM
-
By Shailesh C.Rathod in forum .NET
Replies: 2
Last Post: 03-13-2002, 07:53 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks