Trying to use a Buffered Image any help

I have write the program but cant see what the problem is. My compiler being "blueJ" says cannot resolve symbol- method getImage().
Image has been defined so what is wrong with it, id be grateful for a solution..
My code is as folows.......
import java.applet.Applet;
import java.awt.*;
import java.awt.event.*;
import java.awt.image.*;
public class ImageBuffered extends Applet
private final int RIGHT = 1, LEFT = -1;
private int x, y, w, h;
private Graphics g;
private int dir = RIGHT;
private Image offscreenImage;
public void init()
addMouseListener( new MouseHandler( this ) );
w = getWidth();
h = getHeight();
x = 20;
y = h / 2;
public void start()
g = getGraphics(); paint( g );
public void paint( Graphics g)
Image offscreenImage = getImage();
if( ( offscreenImage == null ) || ( offscreenImage.getHeight( this ) != h ) || ( offscreenImage.getWidth( this ) != w ) )
offscreenImage = createImage( w, h );
setImage( offscreenImage );
g.drawImage( getImage(), 0, 0, this );
class MouseHandler extends MouseAdapter
private Applet applet;
public MouseHandler( Applet a )
applet = a;
public void mouseClicked( MouseEvent e ) {
w = getWidth();
h = getHeight();
Image offscreenImage = getImage();
if ( ( offscreenImage == null ) || ( offscreenImage.getHeight(applet) != h ) || ( offscreenImage.getWidth( applet ) != w ) )
offscreenImage = createImage( w, h ); setImage(offscreenImage );
Graphics ig = getImage().getGraphics();
for( int i = 0; i < 400; i++ )
ig.clearRect( 0, 0, w, h );
ig.setColor( Color.red );
ig.fillRect( x, y, 20, 10 );
ig.setColor( Color.green );
ig.fillRect( x + 20, y + 20, 20, 10 );
paint( g );
x += dir;
try
Thread.sleep( 1 );
catch( InterruptedException ie ){}
if( dir == RIGHT )
dir = LEFT;
else
dir = RIGHT;
Thankyou for your time........
L_Tambiah

You're already calling it in 4 places in your code, aren't you? Where did you expect it to be? Is this code you copied from someplace?
--A                                                                                                                                                                                                                                                                                           

Similar Messages

  • Help! I am trying to use the scripts image processor in Photoshop CC.

    Help! I am trying to use the scripts>image processor in Photoshop CC. When I click on it it comes up with an error saying that it cannot find the Javascript Plug In. I have the newest version of Java installed. How do I get it to work in Photoshop. Do I have to download a separate plug in? Any help would be greatly appreciated.

    Java is not Javascript.
    Do you have a Mac or PC?
    If PC, do you have this file on your system?
    C:\Program Files\Adobe\Adobe Photoshop CC (64 Bit)\Required\Plug-Ins\Extensions\ScriptingSupport.8li
    If not, you've got a corrupted installation of Photoshop.  Uninstalling and reinstalling may help.
    -Noel

  • ReferenceError: photoshop is undefined? Trying to use Dr. Brown Image Processor Pro

    Hello!
    I installed Dr. Brown Image Processor Pro.
    I have Bridge and PS (CS6, CC and CC 2014) x64.
    Had to do a manual install to each folder.
    In Bridge I get the error
    ReferenceError: photoshop is undefined? Trying to use Dr. Brown Image Processor Pro.
    I tried both the CC and CS6 bridge same result.
    I have about 100 1GB plus files I want to size down. and need Image processor.
    Any Advice?
    I tried Dr. Brown's JUST FIX IT, bit it just brought me to the script editor. I'm not a programmer.
    Any advice will be appreciated.
    Maxi

    I wonder if this PDF Processor script would work better for you:
    http://www.ps-bridge-scripts.talktalk.net/
    Look under PSCS Scripts in left most column

  • When I reboot my iMac I'll get hard disk selection instead of fast login and I am not using boot camp! Any help is greatly appriciated!

    When I reboot my iMac I'll get hard disk selection instead of fast login and I am not using boot camp! Any help is greatly appriciated!

    Have you selected which disk you want to boot from? In System Preferences, click startup disk and choose the drive you want as your default boot drive.

  • (-42110) is the error I get when trying to play films on iTunes - any help on this ?, (-42110) is the error I get when trying to play films on iTunes - any help on this ?

    (-42110) is the error I get when trying to play films on iTunes - any help on this ?, (-42110) is the error I get when trying to play films on iTunes - any help on this ?

    Hello AndyDryva
    If you have the latest version of iTunes and the error code is still happening, then the next thing is to remove the SC Info folder on your computer. Check out the article below on how to do that.
    iTunes repeatedly prompts to authorize computer to play iTunes Store purchases
    http://support.apple.com/kb/TS1389
    Regards,
    -Norm G.

  • Hi, I'have selected "Block this ad" when I was in Facebook. Now I can only see an empty page when I try to use my Facebook. Any help in unblocking it? Thanks.

    Hi, I'have selected "Block this ad" when I was in Facebook. Now I can only see an empty page when I try to use my Facebook. Any help in unblocking it? Thanks.

    Apple doesn't have any built-in ad blocking components in teh OS or in Safari...so what ad blocking program or Safari extension are you using?  It should have the ability for you to change its settings.

  • "Sorry, we are unable to log you in" message when trying to purchase a product. Any help please?

    I am trying to purchase (or even use a trial version at least) a product in extension manager and it gives me "Sorry we are unable to log you in" message no matter how many times I press "Log in" button.
    Would appreciate any help please

    Hi Alwaysadobe,
    Glad to hear that you have solved the problem. We also got the help from Adobe Exchange team. They gave the steps below for this issue. If you have any other problems, please let us know. Thanks.
    Xiaoyi
    ========================================================================================== ============================
    If the user has already created a new AdobeID and tried to deleted file at the Application Support/Adobe/opm.db and it is still not working he should try this.
    you could suggest that the user closes all applications and Repair Disk Permissions on OSX:
    2. Open Disk Utility, located at /Applications/Utilities/Disk Utility
    3. Select your startup disk on the left of the Disk Utility window
    4. Select First Aid from the tabs
    Click the "Repair Disk Permissions" button
    It is always a good idea to run Repair Disk Permissions on OSX after an update, say from 10.8 to 10.8.x.
    On Windows he can Run sfc /scannow In the command prompt.
    1. Type sfc /scannow and hit Enter.
    He could also try and disable any 3rd party firewall, antivirus programs. I hope this helps.

  • Iam trying to reinstall the OS X after erasing the hard disc but it can't be completed it says u need to visit the purchase page ??? I tried many time to download it any help

    Iam trying to reinstall the OS X after erasing the hard disc but it can't be completed it says u need to visit the purchase page ??? I tried many time to download it any help

    On the bottom of the MBP is the serial number.  Enter it here and post back the results:
    https://getsupport.apple.com/GetSASO?
    This will identify the exact MBP that you have.
    Ciao.
    The system is under maintenance now.  Try this link instead:
    http://www.chipmunk.nl/klantenservice/applemodel.html
    Message was edited by: OGELTHORPE

  • In Robohelp 11, I am not able to link FrameMaker 12 book. The link to FrameMaker is disabled. I am using TCS 5. Any help as this is important for me to setup single sourcing.

    I have been looking for solutions, but no luck. Any help in getting this resolved would really help.

    I am currently reinstalling TCS5.1, as this recently happened to me as well...
    If you initially installed Rh and Fm from the TCS installer, not from Fm and Rh installers, the linking should work.
    I had projects I was working on, and then overnight, without any updates, etc., both my client and I lost the ability to update existing linked projects.
    I wondered if it was an Adobe server issue, but another member of the client team seemed unaffected.
    I'll try to update this post if when I resolve the issue.

  • Trying to update from firefox 3.0.1 and will not let me put in applications, says I do not have authority. Think I have malware/spying and an unauthorized user on my system. I use a MAC. Any help would be appreciated

    installed firefox 7, the latest update. When I go to transfer to applications, error saying I do not have the authorization. I am the administrator. Cant go further.

    If there are problems with updating or with the permissions then easiest is to download the full version and trash the currently installed version to do a clean install of the new version.
    Download a new copy of the Firefox program and save the disk image (dmg) file to the desktop
    * Firefox 7.0.x: http://www.mozilla.com/en-US/firefox/all.html
    * Trash the current Firefox application to do a clean (re-)install
    * Install the new version that you have downloaded
    Your profile data is stored elsewhere in the Firefox Profile Folder, so you won't lose your bookmarks and other personal data.
    * http://kb.mozillazine.org/Profile_folder_-_Firefox

  • My 12 hour old iPhone 5S will not use LTE. I have tried everything I can do. Any help would be great.

    The LTE slider is highlighted to use it. I have turned the phone off and on, I have put it in airplane mode. Is there anything else?

        @neffuw,
    Let's get you connected to 4G! I definitely want you to be able to use the fastest speeds available in your area. Have you checked to confirm you are in a 4G area? What's your zip code?
    Try removing the SIM card for a minute. Insert and retest. You can also try this http://vz.to/1n96Ez9. Keep us posted.
    JohnB_VZW
    Follow us on Twitter @VZWSupport

  • Hi just trying to get my ipod nano to turn on, i can't figure out why it isn't working. i haven't used it before so any help?

    i have  a ipad nano i think it may be 2nd generation not real sure, but i can't seem to get it to turn on at all. i plugged it into a iphone 4 charger and am currently charging it on the computer. When i plugged it in the computer the computer was configuring and read that the instalation was working. So what could be my problem?
    Thanks!

    The battery may be dead.

  • PHOTOSHOP ELEMENTS 10 USING CANON 7D IMAGE PROBLEMS - HELP PLEASE

    I AM HAVING PROBLEMS WITH ELEMENTS 10 AND IMAGES FROM MY CANON 7D WHEN I DOWNLOAD TO SONY LAPTOP ON WINDOWS VISTA. COLOURS ARE DISTORTED, ESPECIALLY ON REDS WHICH ARE SHOWING AS EXTREMELY VIVID AND SOME BROWNS GOING TO A WINE COLOUR. THIS IS A FAIRLY RECENT PROBLEM AND NOT SURE WHAT I AM DOING WRONG? HAVE I ADJUSTED A SETTING BY MISTAKE? ALL HELP APPRECIATED
    MIKE WEBSTER
    SCOTLAND
    UK
    70 YEARS YOUNG
    [email protected]

    Hi Brian,
    Thanks for your reply.
    I have had the 7d for 4 years or more.
    The images downloaded before from the 7d, we're ok and still look ok, it is only in the past month this has happened and it is not with every image it is intermittent. Some are clear then others on the same shoot have the problem. It is even more exaggerated when printed.
    I have tried Zoom browser and it is less evident on there but still shows.
    I am shooting both with Raw & Jpeg and I think it shows in both.
    Being a mean Scotsman I grudge having paid for Photoshop Elements and not getting the good of it.
    I have tried Adobe on line but no luck and they ask me to pay for an annual contract before they will give me technical support, which is about £100.
    I appreciate your assistance and any further help.
    Best wishes,
    Mike
    Sent from AOL Mobile Mail

  • IPad Air 32GB Wifi model, won't turn on, recover, restore, with error 4005 after trying to use facetime, switched off. :( HELP!

    bought my mom a new iPad Air 32GB WiFi model via eBay and got it yesterday. It worked all fine and I even updated it to the latest iOS version. It worked all fine for the next few hours until I tried to have a facetime call using my iPad Air. Somehow within few seconds after the call being initialized, my moms iPad got switched off. I tried almost all the solutions I found via Apple community, google and other sites. None of them worked. ( Restore, Recovery, DFU Mode, Pressing Home and ON/OFF switch etc ) Somehow I managed to connect the iPad to itunes and when i press the restore button, I get error 4005 after 5 - 10 mins appearing 'waiting for iPad' message. I am in Sri Lanka and I have no Apple Stores here, or authorized service providers. since this isn't a fault of the ebay seller, cannot return it too. Please help me!

    Hi Tom,
    Thank you very much for your time and trying to help me on this issue. I really appreciate it.
    I went through those steps more than few time since yesterday ( saw you had posted this solution on a similar issue by another user )
    still no luck. Now I cannot exit from DFU mode, or either restore it due to 4005 error. ( since its a new iPad, i only had few apps installed. so not going to loose much data as well ). I also try to exit DFU mode by using few third party apps such as Wondershare Dr.Fone, Phone Rescue, ReiBoot, RecBoot. Only wondershare Dr.Fone app showed me a screen with a message saying the iOS device is 'not in normale mode, press home + off/on button to switch to normal mode, which never worked either.
    Really appreciate your help but I am open for more solutions other than Restore, Recovery Mode, DFU mode or any method to overcome error 4005. I would also like to know are there any softwares to diagnose the iPad Air to detect whats wrong with it. so that I can be sure if it is a hardware failure or firmware issue.
    Thanks in advance,
    Nimasha

  • First time trying to use Back To My Mac - help needed

    Hi
    I'm a first time user of Back To My Mac.
    At home I believe I have correctly set up my Time Capsule (my main router) and my Mac Mini (running Yosemite) with Back To My Mac. I did test it before I left home (using my iPhone as a hotspot) and thought that everything was ok.
    Now I am away from home when I try to log in using my wife's MacBook Air (also running Yosemite) I can see my Time Capsule but not my Mac Mini.
    I think that my MacMini might be asleep but I am sure that I have set it to wake on network access.
    Do I need to do something extra to get through to my Mac Mini?
    Any advice would be much appreciated.

    iWork '13 apps can't do Mail Merge. If you have iWork '09, download Pages '09 user guide from the Pages Help menu and read Chapter 11.
    Jerry

Maybe you are looking for

  • How do I find the Music Library I have been using ?

    I have gone from the G 5 to a Mac Mini 2 GHz and all was well . That was before a balky fire wire Lacie Disk didn't show up and the cloned folder failed to produce playlists for 12,000 or so tunes . I would like to find that data for the iTunes prefe

  • What MMC standard, or speed does the Nokia 9300 su...

    In looking thru the manual the 9300 supports 2GB MMC cards, but it does not mention what standard it supports, such as speed. The FAQ on the web Site only mentions that it supports the NOkia 128MB, and 512 Card. In looking at information on these car

  • Launch to specific help page

    I'm sure this has been covered before, but I can't seem to find it when I browse or search. So I apologize for the redundancy... Is there a way to launch RoboHelp so that it opens to a specific topic? For example, you are on an e-mail page and you la

  • Webdynpro java

    How to access SAP R/3 table in webdynpro java in nwds? can u pls tell me steps for that. Thanks,

  • ICal won't refresh appointments unless i click on each day

    Please help! When I enter an appointment on my iPhone and synch to iCal, the appointment doesn't show up in month or week view unless I click on the particular day of the appointment. In other words, the new appointment is actually synched to iCal bu