Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9122975
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T06:13:45+00:00 2026-06-17T06:13:45+00:00

I have made a simple game, it is a state based game meaning I

  • 0

I have made a simple game, it is a state based game meaning I have many different states (screens) such as the start-up screen, menu screen and the actual game, my menu screen is boring at the moment and I want a portion of it to be a video without any controls so it looks like its an animation built into the game, I looked into JMF and found that you only need the following code for it to work(note that I have removed the controls which were in the original code I had found so it is just the video left):

EIDT: The code is shown with comments explaining the error messaged:

    package javagame;

import java.awt.BorderLayout;
import java.awt.Component;
import java.net.URL;

import javax.swing.JFrame;

public class mediaPlayer extends JFrame
    {
        public mediaPlayer()
        {
            setLayout(new BorderLayout());


            URL mediaURL = //Whatever

            Player mediaPlayer = Manager.createRealizedPlayer(mediaURL);
            //Player cannot be resolved as a variable
            //mediaPlayer cannot be resolved as a variable
            //Manager cannot be resolved



            Component video = mediaPlayer.getVisualComponent();
            //The method getVisualComponent() is undefined for thetype mediaplayer
            add(video,BorderLayout.CENTER);

        }
    }

I had made a new class called mediaPlayer and put the above code in it, it extends JFrame but I am getting errors under things like player, mediaplayer and manager saying things like make methods for this, make class for this, make variable for this, I thought that this would work without errors as it extends JFrame and all of the methods, class’s and variables required are already made, am I wrong about this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T06:13:46+00:00Added an answer on June 17, 2026 at 6:13 am

    ..am I wrong about this?

    Yes, you are. The only methods that are automatically included in a frame are those defined for it.

    The methods you are talking about, are part of the JMF. Those classes need to be imported at the top of the code. Something like:

    import javax.media.*;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have made a simple Java game, when I load the game a start-up
I have implemented a simple tile-based collision system in my top-down game, but I
I have a simple game I made in java. Essentially, my programming ability is
I have a simple word jumble game. I made the jumble already, but now
I have made a very simple game in titanium mobile. I only use 90k
I just made a simple HTML5 game for mobile webkit. I have made a
When I have made simple single thread games I implemented the game logic in
I am making a simple game using a JFrame . I have made a
I am a rather new C++ programmer. I have made a very simple game
I'm making a simple game involving a Player class and have made an array

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.