Results 1 to 2 of 2
  1. #1
    Galore is offline Member
    Join Date
    Aug 2009
    Posts
    38
    Rep Power
    0

    Default How to Embed Changing Background Music and Graphics using Applets

    Hello everyone,

    My group mates and I are going to do a java program which should show/prompt the user/viewer different themes/graphics with different background music.

    The scenario should happen this way;

    The user/viewer would enter a particular date: (He/she is expected to enter just four dates. Dates which point to four of the holidays/seasons celebrated in our university namely: Christmas(Dec 25),New Year(Jan 01),Our College's Day (Jan 23-27),Valentine's Day(Feb 14)).

    After doing so,(entering one date at a time), the program should display a season greeting with graphics/theme/image appropriate to the event plus background music. Now, our problem is, we can't roughly think of the most efficient/correct way to do it.

    I look forward to your helpful responses. :)



    Thanks,
    Galore

  2. #2
    travishein's Avatar
    travishein is offline Senior Member
    Join Date
    Sep 2009
    Location
    Canada
    Posts
    684
    Rep Power
    5

    Default

    Like a stand alone desktop type of application ? If this is the case, I would have a look at the "Swing" API. This is the modern built-in windowing and widgets tools. It is possible to create dialog boxes, main windows that let us set backgrounds to be images.

    I would start by making an application load up, create a window of a reasonable size, and set its background to an image that is also in some images folder off of the current working folder or in the classpath, such as stuffed as a resource into the jar file. After getting an image to work as a background, build a dialog with the radio buttons and the ok button to do the operation, launching it at start up.

    For the sound, there is the "Java Media Framework" (JMF) directly from Sun and more recently an open source replacement api, Framework for Media in Java (FMJ). The latter is targeting support on platforms the Sun API does not yet support, such as Linux and MacOS, and being open type of project, is likely to evolve beyond the original JMF standard. I would think looking there is a good start for figuring out how to make an application play sounds.

    Now, if you are looking to build an applet, where the applet would set the background screen in the browser, it likely could also be done using some javascript to have a DHTML screen of radio buttons select a background using some CSS. and for playing the media, maybe a java applet to play / stream a file from the web server.

    or heck, bonus points for making a Java Swing application that works both as a desktop application and as an applet withing a web browser.

Similar Threads

  1. Embed ressources in JAR and load them
    By MasterD in forum New To Java
    Replies: 16
    Last Post: 04-06-2009, 10:57 PM
  2. Replies: 1
    Last Post: 10-16-2008, 09:56 PM
  3. Play music
    By carderne in forum New To Java
    Replies: 4
    Last Post: 08-05-2008, 01:09 PM
  4. How to embed Swing and AWT in SWT
    By Java Tip in forum SWT
    Replies: 0
    Last Post: 07-02-2008, 08:07 PM
  5. Email Embed Image
    By gui.gomes in forum Advanced Java
    Replies: 3
    Last Post: 11-19-2007, 02:08 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
  •