Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

java

  • 11-03-2003 4:21pm
    #1
    Closed Accounts Posts: 5,093 ✭✭✭


    hi im only a first yr in software development but i developed this applet but it wont work. its meant to have a picture of thomas the tank engine and when you press the button it makes the sound of a train but the pic wont appear. can anyone help?


Comments

  • Closed Accounts Posts: 5,093 ✭✭✭woosaysdan


    this is the pic i cant post the audio file


  • Registered Users, Registered Users 2 Posts: 6,240 ✭✭✭hussey


    well firstly you have :

    image = getImage(getDocumentBase(),getParameter("file"));
    audio = getAudioClip(getDocumentBase(),getParameter("file"));

    so they are looking for the same paramater


  • Closed Accounts Posts: 8,478 ✭✭✭GoneShootin


    and

    Image image;
    AudioClip audio;

    these have to be given a specific name, so if you audio file is TANK.WAV, or TANK.JPG, they have to be assigned as such.

    forums.java.sun.com is an excellent resource for all things java


  • Registered Users, Registered Users 2 Posts: 6,240 ✭✭✭hussey


    Dunno bout that gone Shooting

    just another thing I noticed
    you have :
    <param name = "file" value = "thomas4.jpg>
    you are missing a "................................... ^^here

    This code worked ok for me
    <html>
    <applet code = "train.class" width= 300 height= 300>
    <param name = "file" value = "thomas4.jpg">
    </applet>
    </html>
    
    public class train extends Applet
    {
    	Image image;
    	//AudioClip audio;
    	public void init()
    	{
    	image = getImage(getDocumentBase(),getParameter("file"));
    	}
    	public void paint(Graphics g)
    	{
    		g.drawImage(image,10,10,this);
    		
    	}
    }
    

    I've edited it a bit but not much


  • Closed Accounts Posts: 5,093 ✭✭✭woosaysdan


    cheers i'll try that thanks.


  • Advertisement
Advertisement