Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Problem Importing Pictures
Index -> Programming, Java -> Java Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
ste_louis26




PostPosted: Tue Dec 27, 2005 5:02 pm   Post subject: Problem Importing Pictures

(ready to program)
I'm having a problem at the the 14-17th lines in the following code
i'm getting the following errors:

No Method named 'getToolkit' was found in type "hsa.Console".
No Method named 'prepareImage' was found in type "hsa.Console".
No applicable overload was found for a constructor of type "java.awt......etc


Quote:

import java.awt.*;
import hsa.*;
import java.applet.*;

public class SimpleGif
{
static Console c;
static Image picture;
static int picWidth, picHeight;
private static final String fileName = "mypic.gif";

public static void loadImage ()
{
picture = c.getToolkit ().getImage (fileName);
c.prepareImage (picture, c);

MediaTracker tracker = new MediaTracker (c);
tracker.addImage (picture, 0);
try
{
tracker.waitForAll ();
}
catch (InterruptedException e)
{
}

if (tracker.isErrorAny ())
{
c.println ("Coundn't load " + fileName);
return;
}

picWidth = picture.getWidth (null);
picHeight = picture.getHeight (null);
}


public static void displayImage ()
{
loadImage ();
c.drawImage (picture, 0, 0, null);
c.drawImage (picture, 100, 0, null);
c.drawImage (picture, 200, 300, null);
c.drawImage (picture, 300, 200, null);
c.drawImage (picture, 300 + picWidth, 200 + picHeight, null);
}


public SimpleGif ()
{
c = new Console ();
}


public static void main (String[] args)
{
SimpleGif g = new SimpleGif ();
g.displayImage ();
}
}


any help?
Sponsor
Sponsor
Sponsor
sponsor
Display posts from previous:   
   Index -> Programming, Java -> Java Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 1 Posts ]
Jump to:   


Style:  
Search: