Need help adding an image

I am trying to add an image to my display but I have been unable to do so. Does anyone have any suggestions?
import javax.swing.*;
import java.awt.event.*;
import javax.swing.Icon;
import javax.swing.ImageIcon;
public class Inventory5 extends JFrame
     private String[] data = { "Star Wars", "Raiders of the Lost Ark",
     "The Natural", "Lost Boys", "Old School", "The Lord of the Rings" };
     private JButton nextBtn;
     private JButton backBtn;
     private JButton firstBtn;
     private JButton lastBtn;
     private JTextField dataField;
     private int currIndex = 0;
     public Inventory5 ()
          nextBtn   = new JButton("Next");
          backBtn   = new JButton("Back");
          firstBtn  = new JButton("First");
          lastBtn   = new JButton("Last");
          dataField = new JTextField(20);
          this.getContentPane().setLayout(new java.awt.FlowLayout());
          this.getContentPane().add(dataField);
          this.getContentPane().add(nextBtn);
          this.getContentPane().add(backBtn);
          this.getContentPane().add(firstBtn);
          this.getContentPane().add(lastBtn);
          this.pack();
          this.setResizable(false);
          this.setLocationRelativeTo(null);
        this.setSize( 275,180 );
          this.setTitle("DVD Inventory List");
          this.setDefaultCloseOperation(EXIT_ON_CLOSE);
          goFirst();
              nextBtn.addActionListener(new ActionListener()
                    public void actionPerformed(ActionEvent evt)
                         goNext();
               backBtn.addActionListener(new ActionListener()
                    public void actionPerformed(ActionEvent evt)
                         goBack();
               firstBtn.addActionListener(new ActionListener()
                    public void actionPerformed(ActionEvent evt)
                         goFirst();
               lastBtn.addActionListener(new ActionListener()
                    public void actionPerformed(ActionEvent evt)
                         goLast();
               private void goNext()
                    if (currIndex < data.length -1)
                         currIndex++;
                         dataField.setText(data[currIndex]);
               private void goBack()
                    if (currIndex > 0)
                         currIndex--;
                         dataField.setText(data[currIndex]);
               private void goFirst()
                    currIndex = 0;
                    dataField.setText(data[currIndex]);
               private void goLast()
                    currIndex = data.length - 1;
                    dataField.setText(data[currIndex]);
               public static void main(String [] argv)
                    new Inventory5().setVisible(true);
}

Ok here is what I have so far, but I'm not sure where to go next.
import javax.swing.*;
import java.awt.event.*;
import javax.swing.Icon;
import javax.swing.ImageIcon;
public class Inventory5 extends JFrame
     private String[] data = { "Star Wars", "Raiders of the Lost Ark",
     "The Natural", "Lost Boys", "Old School", "The Lord of the Rings" };
     private JButton nextBtn;
     private JButton backBtn;
     private JButton firstBtn;
     private JButton lastBtn;
     private JTextField dataField;
     private int currIndex = 0;
     public Inventory5 ()
          nextBtn   = new JButton("Next");
          backBtn   = new JButton("Back");
          firstBtn  = new JButton("First");
          lastBtn   = new JButton("Last");
          dataField = new JTextField(20);
          JPanel panel1 = new JPanel();
          ImageIcon icon = new ImageIcon("C:\Documents and Settings\Compaq_Owner\My Documents\My Pictures");
        panel1.add(new JLabel(icon));
        this.add(panel1);
          this.getContentPane().setLayout(new java.awt.FlowLayout());
          this.getContentPane().add(dataField);
          this.getContentPane().add(nextBtn);
          this.getContentPane().add(backBtn);
          this.getContentPane().add(firstBtn);
          this.getContentPane().add(lastBtn);
          this.pack();
          this.setResizable(false);
          this.setLocationRelativeTo(null);
        this.setSize( 275,180 );
          this.setTitle("DVD Inventory List");
          this.setDefaultCloseOperation(EXIT_ON_CLOSE);
          goFirst();
              nextBtn.addActionListener(new ActionListener()
                    public void actionPerformed(ActionEvent evt)
                         goNext();
               backBtn.addActionListener(new ActionListener()
                    public void actionPerformed(ActionEvent evt)
                         goBack();
               firstBtn.addActionListener(new ActionListener()
                    public void actionPerformed(ActionEvent evt)
                         goFirst();
               lastBtn.addActionListener(new ActionListener()
                    public void actionPerformed(ActionEvent evt)
                         goLast();
               private void goNext()
                    if (currIndex < data.length -1)
                         currIndex++;
                         dataField.setText(data[currIndex]);
               private void goBack()
                    if (currIndex > 0)
                         currIndex--;
                         dataField.setText(data[currIndex]);
               private void goFirst()
                    currIndex = 0;
                    dataField.setText(data[currIndex]);
               private void goLast()
                    currIndex = data.length - 1;
                    dataField.setText(data[currIndex]);
               public static void main(String [] argv)
                    new Inventory5().setVisible(true);
}

Similar Messages

  • I need help adding a mouse motion listner to my game. PLEASE i need it for

    I need help adding a mouse motion listner to my game. PLEASE i need it for a grade.
    i have a basic game that shoots target how can use the motion listner so that paint objects (the aim) move with the mouse.
    i am able to shoot targets but it jus clicks to them ive been using this:
    public void mouse() {
    dotX = mouseX;
    dotY = mouseY;
    int d = Math.abs(dotX - (targetX + 60/2)) + Math.abs(dotY - (targetY + 60/2));
    if(d < 15) {
    score++;
    s1 = "" + score;
    else {
    score--;
    s1 = "" + score;
    and here's my cross hairs used for aiming
    //lines
    page.setStroke(new BasicStroke(1));
    page.setColor(Color.green);
    page.drawLine(dotX-10,dotY,dotX+10,dotY);
    page.drawLine(dotX,dotY-10,dotX,dotY+10);
    //cricle
    page.setColor(new Color(0,168,0,100));
    page.fillOval(dotX-10,dotY-10,20,20);
    please can some1 help me

    please can some1 help meNot when you triple post a question:
    http://forum.java.sun.com/thread.jspa?threadID=5244281
    http://forum.java.sun.com/thread.jspa?threadID=5244277

  • Need help adding schedule to xcode 4

    I need help adding a tour schedule for an iphone app building an app for 13 djs and they want thier tour schedules added these need to be updated monthly is there a way to add this????

    I don't know if this is the easiest way but it works for me. I connect the DVD player to my camcorder (so it's the 3 plugs yellow/red/white on one end and a single jack into the camera). Then I connect my camcorder to the computer (I think it's through a firewire port). Then I just play the DVD and the footage is digitized via the camcorder and I import it into iMovie 4 as it's playing. I believe the camcorder is just in VCR mode.
    I have also used this method to transfer VHS tapes onto DVDs via the camera by connecting the VCR to the camera.
    I haven't had much luck with movies over about 40 minutes on iMovie. But if it's home movies, there may be a logical break. Do maybe 20 minute segments (it's also really easy on iMovie to add a soundtrack if these are OLD films with no sound.
    As you can see, I'm low tech!
    Good luck!
    Powerbook G4   Mac OS X (10.3.9)  

  • Need help deleting an image field/pictures in worksheet

    I am in need of help!!! Added photos in an important .pdf document (a worksheet form that was pre-made) and I added image fields (Top box photo and small bottom box for text). I need to delete some image fields now and it won't let me. I upgraded my Adobe Reader to Acrobat XI Pro trial, still can't. If I try to edit image, it says I need to have Live Cycle designer to edit this form. Someone please help! This is my son's Eagle Scout worksheet and needs to be fixed tonight....please

    If the file was created in LiveCycle Designer then it can only be edited
    there.
    It's not clear in what way you edited it originally.

  • I need help dividing an image into two equal parts in Adobe Illustrator CC--ASAP!!!

    I need help dividing a single, already created image into 2 equal parts...Am getting nowhere so far

    Hi Willi, thanks so much for responding! Below is the image I need to divide in half. The left half where it says "Click here for the definition" links to a landing page where people can read the definition of the Hebrew Word. The right half links to an audio recording of the Hebrew word being spoken aloud. I am trying to figure out how to use the scissors or knife tool in Adobe Illustrator and am having no luck. Plus I believe there's a way to include URLs on each separated part, but I can't get past figuring out how to cut it. My background is not graphic design

  • Need help [JS]: select images/captions in InD, switch to Bridge and write to XMP

    I've got a javascript for CS3/Tiger that I'm writing that eventually will let a user select an image and a caption in InDesign, then tells bridge to write the caption data into the image metadata. I need help - the script works in pieces, but not when put together.
    It's built as an indesign script, then follows the procedure to create a script object to send to bridge. When it runs, the indesign portion works fine, but nothing happens in bridge.
    The script is below, with comments.
    Can someone help!? Thanks.
    // This is the InDesign portion of the script, which was tested separately and is working fine. Right now, for testing purposes, the data from this portion isn't even used by the later Bridge portion but once I get the bridge part together, it will use those variables.
    #target "indesign-5.0"
    var myObjectList = new Array;
    //Script does nothing if no documents are open or if no objects are selected.
    if(app.documents.length != 0){
    if(app.selection.length != 0){
    for(myCounter = 0; myCounter < app.selection.length; myCounter ++){
    switch(app.selection[myCounter].constructor.name){
    case "TextFrame":
    var myCaption = app.selection[myCounter].contents;
    $.writeln(myCaption);
    break;
    default:
    var myLink = app.selection[myCounter].graphics[0].itemLink.filePath;
    $.writeln(myLink);
    // here's where I create the string of the script to send to Bridge.
    // the script itself is almost completely a lifted from the SnpModifyMetadta sample from the Bridge sdk
    // it basically finds a certain image file and modifies the description metatata. i hardcoded the caption text and image path just for testing- eventually i would like it to use the variables from indesign.
    // this script works fine as-is when run in the original Bridge scripting context.
    // the method here of concatenating and sending the myScript string works fine when i use a different (smaller) script. so i can't tell why it's not working!?
    var myScript = "function SnpModifyMetadata()";
    myScript += "{";
    myScript += " this.requiredContext = \"Needs to run in Bridge, \nwith a selection of a file, \nideally with some metadata\";";
    myScript += "}";
    myScript += "SnpModifyMetadata.prototype.run = function()";
    myScript += "{";
    myScript += " if(!this.canRun())";
    myScript += " {";
    myScript += " return false;";
    myScript += " }";
    myScript += " if( xmpLib == undefined )";
    myScript += " {";
    myScript += " if( Folder.fs == \"Windows\" )";
    myScript += " {";
    myScript += " var pathToLib = Folder.startup.fsName + \"/AdobeXMPScript.dll\";";
    myScript += " }";
    myScript += " else";
    myScript += " {";
    myScript += " var pathToLib = Folder.startup.fsName + \"/AdobeXMPScript.framework\";";
    myScript += " }";
    myScript += " var libfile = new File( pathToLib );";
    myScript += " var xmpLib = new ExternalObject(\"lib:\" + pathToLib );";
    myScript += " }";
    myScript += " $.writeln(\"About to run SnpModifyXML\");";
    myScript += " var thumb = new Thumbnail(Folder(\"/Macintosh HD/Users/hearstuser/Desktop/BridgeScriptImages/orion_stack copy 6.psd\"));";
    myScript += " if(thumb.hasMetadata)";
    myScript += " {";
    myScript += " var md = thumb.synchronousMetadata;";
    myScript += " var xmp = new XMPMeta(md.serialize());";
    myScript += " $.writeln(\"SnpModifyXML: About to modify XMP data for \" + thumb.name);";
    myScript += " $.writeln(\"XMP packet before modifications:\");";
    myScript += " $.writeln(\"-------------------------------------------------\");";
    myScript += " $.writeln(xmp.dumpObject());";
    myScript += " xmp.deleteProperty(XMPConst.NS_XMP, \"Description\");";
    myScript += " xmp.setProperty(XMPConst.NS_XMP, \"Description\", \"hoThereHeyThere\");";
    myScript += " var d = new XMPDateTime(new Date());";
    myScript += " d.convertToLocalTime();";
    myScript += " xmp.setProperty(XMPConst.NS_XMP, \"ModifyDate\", d, XMPConst.XMPDATE);";
    myScript += " $.writeln(\"XMP packet af

    Recently I received an e-mail from a user asking me to remake the script I had posted here a while ago.
    I rechecked my previous post and found a couple of serious mistakes. So I revised it according to what he asked. Each page in his InDesign document contains one image and one text frame with description.
    At start the script checks the selection. If nothing is selected it processes all pages in the document. In case two objects are selected – it checks whether one of them text frame and the other a rectangle and if the rectangle contains an image, then it reads the contents of the text frame, replacing hard and soft returns with spaces and writes this text to the corresponding image’s description field.
    In the end, it updates all links and saves the file.
    The script works both on Mac and PC, assuming that CS3 installed in the default location so long as it depends on libraries:
    /C/Program Files/Adobe/Adobe Bridge CS3/AdobeXMPScript.dll (on PC)
    /Applications/Adobe Bridge CS3/Bridge CS3.app/Contents/MacOS/AdobeXMPScript.framework (on MAC)
    So, if necessary, correct these lines.
    Here is my script in case somebody is interested:
    #target indesign
    var myDoc = app.activeDocument;
    var mySelection = app.selection;
    if (mySelection.length == 0) {
        ProcessPages();
    else if (mySelection.length == 1) {
        alert("One image and one textframe should be selected.");
        exit();   
    else if (mySelection.length == 2) {
        try {
            if (mySelection[0].constructor.name == "TextFrame" && mySelection[1].images.length == 1) {
                var myTextFrame = mySelection[0];
                var myImage = mySelection[1].images[0];
                var myCaption = ReplaceReturnWithSpace(myTextFrame.contents);
                var myPath = new File(myImage.itemLink.filePath).absoluteURI;
            else if (mySelection[1].constructor.name == "TextFrame" && mySelection[0].images.length == 1) {
                var myTextFrame = mySelection[1];
                var myImage = mySelection[0].images[0];
                var myCaption = ReplaceReturnWithSpace(myTextFrame.contents);
                var myPath = new File(myImage.itemLink.filePath).absoluteURI;
        catch(e) {
            alert("Something wrong with your selection.\nError: " + e.message);
            exit();
        CreateBridgeTalkMessage(myCaption, myPath);
    else if (mySelection.length > 2) {
        alert("One image and one textframe should be selected.");
        exit();
    UpdateAllOutdatedLinks();
    myDoc.save();
    alert("All done.");
    //+++++++++++++++++++ FUNCTIONS ++++++++++++++++++++++
    function CreateBridgeTalkMessage(myCaption, myPath) {
        var bt = new BridgeTalk();
        bt.target = "bridge";
        var myScript = WriteCaption.toString() + '\r';
        myScript += 'WriteCaption(\"' + myCaption + '\", \"' + myPath + '\");';
        bt.body = myScript;
        bt.send();
    function WriteCaption(myCaption, myPath) {
        if( xmpLib == undefined ) {
            if( Folder.fs == "Windows") {
                var pathToLib = "/C/Program Files/Adobe/Adobe Bridge CS3/AdobeXMPScript.dll";
            else {
                var pathToLib = "/Applications/Adobe Bridge CS3/Bridge CS3.app/Contents/MacOS/AdobeXMPScript.framework";
            var libfile = new File( pathToLib );
            var xmpLib = new ExternalObject("lib:" + pathToLib );
        var thumb = new Thumbnail (File (myPath));
        if (thumb.hasMetadata) {
            var md = thumb.synchronousMetadata;
            var xmp = new XMPMeta(md.serialize());
            xmp.deleteProperty(XMPConst.NS_XMP, "Description");
            xmp.setProperty(XMPConst.NS_XMP, "Description", myCaption);
            var updatedPacket = xmp.serialize(XMPConst.SERIALIZE_OMIT_PACKET_WRAPPER | XMPConst.SERIALIZE_USE_COMPACT_FORMAT);
            thumb.metadata = new Metadata(updatedPacket);
    function ProcessPages() {
        var myPages = myDoc.pages;
        for (i = 0; i < myPages.length; i++) {
            var myPage = myPages[i];
            if (myPage.textFrames.length == 1 && myPage.rectangles.length == 1) {
                if (myPage.rectangles[0].graphics.length == 1) {
                var a = myPage.rectangles[0];
                    var myImage = myPage.rectangles[0].graphics[0];
                    var myPath = new File(myImage.itemLink.filePath).absoluteURI;
                    var myTextFrame = myPage.textFrames[0];
                    var myCaption = ReplaceReturnWithSpace(myTextFrame.contents);
                    CreateBridgeTalkMessage(myCaption, myPath);
    function ReplaceReturnWithSpace(myString) {
        myString = myString.replace( /\n/g , " " );
        myString = myString.replace( /\r/g , " " );
        return myString;
    function UpdateAllOutdatedLinks() {
        for(var myCounter = myDoc.links.length-1; myCounter >= 0; myCounter--){
            var myLink = myDoc.links[myCounter];
            if (myLink.status == LinkStatus.linkOutOfDate){
                myLink.update();
    If somebody interested in developing this script further, do not hesitate to post here your feedback.
    Kasyan

  • Need help adding Arch to Grub

    I am trying to dual boot Arch Linux and Ubuntu. When I try to boot there is no option for Arch. I have added it to the menu.lst file in ubuntu. Arch is installed on sdb1 according to sudo fdisk -l  I need help!

    Fdisk -l
    Disk /dev/sda: 80.0 GB, 80026361856 bytes
    255 heads, 63 sectors/track, 9729 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Disk identifier: 0xb38ab38a
       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1   *           1        9544    76662148+  83  Linux
    /dev/sda2            9545        9729     1486012+   5  Extended
    /dev/sda5            9545        9729     1485981   82  Linux swap / Solaris
    Disk /dev/sdb: 40.9 GB, 40992473088 bytes
    255 heads, 63 sectors/track, 4983 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Disk identifier: 0x0002eb1f
       Device Boot      Start         End      Blocks   Id  System
    /dev/sdb1   *           1        4891    39286926   83  Linux
    Disk /dev/sdc: 250.0 GB, 250059350016 bytes
    255 heads, 63 sectors/track, 30401 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Disk identifier: 0x000ea9be
       Device Boot      Start         End      Blocks   Id  System
    /dev/sdc1               1       30401   244196001    7  HPFS/NTFS
    I think Arch is on the 40GB partition
    Menu.lst
    # menu.lst - See: grub(8), info grub, update-grub(8)
    #            grub-install(8), grub-floppy(8),
    #            grub-md5-crypt, /usr/share/doc/grub
    #            and /usr/share/doc/grub-doc/.
    ## default num
    # Set the default entry to the entry number NUM. Numbering starts from 0, and
    # the entry number 0 is the default if the command is not used.
    # You can specify 'saved' instead of a number. In this case, the default entry
    # is the entry saved with the command 'savedefault'.
    # WARNING: If you are using dmraid do not use 'savedefault' or your
    # array will desync and will not let you boot your system.
    default        0
    ## timeout sec
    # Set a timeout, in SEC seconds, before automatically booting the default entry
    # (normally the first entry defined).
    timeout        0
    ## hiddenmenu
    # Hides the menu by default (press ESC to see the menu)
    hiddenmenu
    # Pretty colours
    #color cyan/blue white/blue
    ## password ['--md5'] passwd
    # If used in the first section of a menu file, disable all interactive editing
    # control (menu entry editor and command-line)  and entries protected by the
    # command 'lock'
    # e.g. password topsecret
    ## password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
    # password topsecret
    # examples
    # title        Windows 95/98/NT/2000
    # root        (hd0,0)
    # makeactive
    # chainloader    +1
    # title        Linux
    # root        (hd0,1)
    # kernel    /vmlinuz root=/dev/hda2 ro
    # Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST
    ### BEGIN AUTOMAGIC KERNELS LIST
    ## lines between the AUTOMAGIC KERNELS LIST markers will be modified
    ## by the debian update-grub script except for the default options below
    ## DO NOT UNCOMMENT THEM, Just edit them to your needs
    ## ## Start Default Options ##
    ## default kernel options
    ## default kernel options for automagic boot options
    ## If you want special options for specific kernels use kopt_x_y_z
    ## where x.y.z is kernel version. Minor versions can be omitted.
    ## e.g. kopt=root=/dev/hda1 ro
    ##      kopt_2_6_8=root=/dev/hdc1 ro
    ##      kopt_2_6_8_2_686=root=/dev/hdc2 ro
    # kopt=root=UUID=ce3a864f-3f72-480b-96b3-54516b307170 ro
    ## default grub root device
    ## e.g. groot=(hd0,0)
    # groot=ce3a864f-3f72-480b-96b3-54516b307170
    ## should update-grub create alternative automagic boot options
    ## e.g. alternative=true
    ##      alternative=false
    # alternative=true
    ## should update-grub lock alternative automagic boot options
    ## e.g. lockalternative=true
    ##      lockalternative=false
    # lockalternative=false
    ## additional options to use with the default boot option, but not with the
    ## alternatives
    ## e.g. defoptions=vga=791 resume=/dev/hda5
    # defoptions=quiet splash
    ## should update-grub lock old automagic boot options
    ## e.g. lockold=false
    ##      lockold=true
    # lockold=false
    ## Xen hypervisor options to use with the default Xen boot option
    # xenhopt=
    ## Xen Linux kernel options to use with the default Xen boot option
    # xenkopt=console=tty0
    ## altoption boot targets option
    ## multiple altoptions lines are allowed
    ## e.g. altoptions=(extra menu suffix) extra boot options
    ##      altoptions=(recovery) single
    # altoptions=(recovery mode) single
    ## controls how many kernels should be put into the menu.lst
    ## only counts the first occurence of a kernel, not the
    ## alternative kernel options
    ## e.g. howmany=all
    ##      howmany=7
    # howmany=all
    ## specify if running in Xen domU or have grub detect automatically
    ## update-grub will ignore non-xen kernels when running in domU and vice versa
    ## e.g. indomU=detect
    ##      indomU=true
    ##      indomU=false
    # indomU=detect
    ## should update-grub create memtest86 boot option
    ## e.g. memtest86=true
    ##      memtest86=false
    # memtest86=true
    ## should update-grub adjust the value of the default booted system
    ## can be true or false
    # updatedefaultentry=false
    ## should update-grub add savedefault to the default options
    ## can be true or false
    # savedefault=false
    ## ## End Default Options ##
    title        Ubuntu 9.04
    uuid        ce3a864f-3f72-480b-96b3-54516b307170
    kernel        /boot/vmlinuz-2.6.28-11-generic root=UUID=ce3a864f-3f72-480b-96b3-54516b307170 ro quiet splash
    initrd        /boot/initrd.img-2.6.28-11-generic
    quiet
    #title        Ubuntu 9.04, kernel 2.6.28-11-generic (recovery mode)
    #uuid        ce3a864f-3f72-480b-96b3-54516b307170
    #kernel        /boot/vmlinuz-2.6.28-11-generic root=UUID=ce3a864f-3f72-480b-96b3-54516b307170 ro  single
    #initrd        /boot/initrd.img-2.6.28-11-generic
    #title        Ubuntu 9.04, memtest86+
    #uuid        ce3a864f-3f72-480b-96b3-54516b307170
    #kernel        /boot/memtest86+.bin
    #quiet
    # (0) Arch Linux
    title  Arch Linux 
    root   (hd1,0)
    kernel /vmlinuz26 root=/dev/sda3 ro
    initrd /kernel26.img
    ### END DEBIAN AUTOMAGIC KERNELS LIST
    title Arch
    rootnoverify (hd0,1)
    chainloader +1

  • Need help to find image size box

    I am a novice, I need to find the image size box on illistrator but not able to so please explaine how to find it on the page.  Thanks

    You may also be talking about the "Info" window. To open it, go to Window > Info or hit command+F8. It will show you the dimensions of the bounding box containing whatever object you have selected.
    Please let us know if we can help you further.

  • Need help with Applet: Images

    DUKESTARS HERE, YOU KNOW YOU WANNA
    Hi,
    I'm designing an applet for some extra credit and I need help.
    This game that i have designed is called "Digit Place Game", but there is no need for me to explain the rules.
    The problem is with images.
    When I start the game using 'appletviewer', it goes to the main menu:
    http://img243.imageshack.us/img243/946/menuhy0.png
    Which is all good.
    But I decided that when you hover your cursor over one of the options such as: Two-Digits or Three-Digits, that the words that are hovered on turn green.
    http://img131.imageshack.us/img131/6231/select1ch3.png
    So i use the mouseMoved(MouseEvent e) from awt.event;
    The problem is that when i move the mouse around the applet has thick line blotches of gray/silver demonstrated below (note: these are not exact because my print screen doesn't take a picture of the blotches)
    http://img395.imageshack.us/img395/4974/annoyingmt1.png
    It also lags a little bit.
    I have 4 images in my image folder that's in the folder of the source code
    The first one has all text blue. The second one has the first option, Two-Digits green but rest blue. The third one has the second option, Three-Digits green but rest blue, etc.
    this is my code
    import java.applet.Applet;
    import java.awt.Graphics;
    import java.awt.event.*;
    import java.awt.*;
    public class DigitPlaceGame extends Applet implements MouseListener, MouseMotionListener {
         public boolean load = false;
         public boolean showStartUp = false;
         public boolean[] hoverButton = new boolean[3];
         Image load1;
         Image showStartUp1;
         Image showStartUp2;
         Image showStartUp3;
         Image showStartUp4;
         public void init() {
              load = true;
              this.resize(501, 501);
                   try {
                        load1 = getImage(getCodeBase(), "images/load1.gif");
                        repaint();
                   } catch (Exception e) {}
              load();
         public void start() {
         public void stop() {
         public void destroy() {
         public void paint(Graphics g) {
              if(load == true) {
                   g.drawImage(load1, 0, 0, null, this);
              } else if(showStartUp == true) {
                   if(hoverButton[0] == true) {
                        g.drawImage(showStartUp2, 0, 0, null, this);
                   } else if(hoverButton[1] == true) {
                        g.drawImage(showStartUp3, 0, 0, null, this);
                   } else if(hoverButton[2] == true) {
                        g.drawImage(showStartUp4, 0, 0, null, this);
                   } else {
                        g.drawImage(showStartUp1, 0, 0, null, this);
                        for(int i = 0; i < 3; i++) {
                             hoverButton[i] = false;
         public void load() {
              addMouseListener(this);
              addMouseMotionListener(this);
              showStartUp1 = getImage(getCodeBase(), "images/showStartUp1.gif");
              showStartUp2 = getImage(getCodeBase(), "images/showStartUp2.gif");
              showStartUp3 = getImage(getCodeBase(), "images/showStartUp3.gif");
              showStartUp4 = getImage(getCodeBase(), "images/showStartUp4.gif");
              showStartUp();
         public void showStartUp() {
              load = false;
              showStartUp = true;
         public void mouseClicked(MouseEvent e) {
              System.out.println("test");
         public void mouseMoved(MouseEvent e) {
              int x = e.getX();
              int y = e.getY();
              if(x >= 175 && x <= 330 && y >= 200 && y <= 235) {
                   hoverButton[0] = true;
                   repaint();
              } else if(x >= 175 && x <= 330 && y >= 250 && y <= 280) {
                   hoverButton[1] = true;
                   repaint();
              } else if(x >= 175 && x <= 330 && y >= 305 && y <= 335) {
                   hoverButton[2] = true;
                   repaint();
              } else {
                        for(int i = 0; i < 3; i++) {
                             hoverButton[i] = false;
                        repaint();
         public void mouseEntered(MouseEvent e) {
         public void mouseExited(MouseEvent e) {
         public void mousePressed(MouseEvent e) {
         public void mouseReleased(MouseEvent e) {
         public void mouseDragged(MouseEvent e) {
    }plox help me ploz, i need the extra credit for an A
    can you help me demolish the lag and stop the screen from flickering? thanks!!!!!
    BTW THIS IS EXTRA CREDIT NOT HOMework
    DUKESTARS HERE, YOU KNOW YOU WANNA
    Edited by: snoy on Nov 7, 2008 10:51 PM
    Edited by: snoy on Nov 7, 2008 10:53 PM

    Oh yes, I knew there could be some problem.......
    Now try this:
    boolean a,b,c;
    if((a=(x >= 175 && x <= 330 && y >= 200 && y <= 235)) && !hoverButton[0]) {
                   hoverButton[0] = true;
                   repaint();
              } else if((b=(x >= 175 && x <= 330 && y >= 250 && y <= 280)) && !hoverButton[1]) {
                   hoverButton[1] = true;
                   repaint();
              } else if((c=(x >= 175 && x <= 330 && y >= 305 && y <= 335)) && !hoverButton[2]) {
                   hoverButton[2] = true;
                   repaint();
              } else if ((!a && !b && !c)&&(hoverButton[0] || hoverButton[1] || hoverButton[2]){
                        for(int i = 0; i < 3; i++) {
                             hoverButton[i] = false;
                        repaint();
              }hope it works........
    Edited by: T.B.M on Nov 8, 2008 10:41 PM

  • I have a godaddy website with a welcome page- I need help adding a few additional pages with a hyperlink to my welcome page.

    I need help attaching a few hyperlinks my godaddy welcome page. I have 2 more ipages articles, I also converted them to pdf. Godaddy only helped (last year) with the 1st article.  I do not know how to attach a hyperlink to the artlcles and add the hyperlinks to my welcome page.

    The program is called Pages not iPages. Just let us know if you do not speak English and what language you do speak so we can adjust for that.
    The issues are to do with your web page not with Pages.
    I think you are asking how to link from your web page to your pdf articles. You must first copy those pdfs to your web server, or some other web location, and then provide html links on your welcome page to those pdf files.
    The pdfs themselves may contain links to other locations but I can not see that that is what you are asking for.
    Nor to what those links would be to.
    From your heading I think you may have confused the name of Pages, the word processing program, with web pages which are two different things.
    Peter

  • I need help editing an image in Photoshop

    I need to edit this image.
    I need to reposition the fist shape a little further down remaining within the yellow circle.  Then I also need to change all blue parts to black and the yellow outline around the knuckles to white.
    How would I do this in Photoshop?

    Put a circular selection round the fist and press Ctrl+J.
    Hide the resulting new layer and fill the circle with yellow.
    Select the blue area with the magic wand and fill the selection with black.
    Select the yellow round the fist and fill the selection with white.
    Go to the fist layer, press Ctrl+T and move it down as far as you want, (Not much room there.)
    For print, save as a TIFF; for Internet use Save for Web.

  • ComboBox (dropdown) Need Help Adding URL links!!!

    I am somewhat of a newbie....Anybody know how to use URL
    links in a ComboBox dropdown menu? NEED HELP!!!!!!! I'm trying to
    make it so that after selecting an option, the user is directed to
    another URL within the same browser window. Using flash 8!
    Thanks,

    Im a bit a newbie myslef but i think you make flash
    commuincate to javascript wich will make the browser goto the URL.
    do a search on getURL and javascript together and i am sure
    you will find something.
    And when slecting to redirct i think its on?(onPress)
    something so maybe look throught the help section in flash 8 and
    look at componets. I think there is some actionscript help there.
    Sorry i could not be more helpful.

  • Need help adding image to datagrid column

    Hi,
    Can anyone tell me how to add an image to a datagrid column?
    I have created a flex library project which contains a mxml component with a datagrid, an item renderer mxml component which rendered the image within the datagrid column depending on the value coming back from the database for that column and a folder 'assets' which hold all the images. When I add the library to my main project and call the mxml component with the datagrid an image place holder is visible in the datagrid column but not the image. However, if I take the image out of the library project and added to an 'assets' folder in the main project the image is displayed in the datagrid column.
    It looks like, even though the images are in the flex library project and only the flex library project is trying to display the images in the datagrid, the library project is looking in the main application project folder for the image.
    Does anyone know why this is happening and how to fix it?
    Thanks in advance for an help,
    Xander.

    I have tried embedding the images in my library but it still didn't work. Also I can't embed the image as I'm using the value of the column to complete the image name, for example in my mxml item renderer component I have the added the following code
    <mx:Image source="@Embed(source='assets/' + data.mycolumnvalue + '.png')" tooltip="{data.mycolumnvalue}"/>
    but nothing is displayed.

  • Needs help adding images to movie clips and referencing the frames

    i havent started with a blank, script made movie clip.
    I want to add frames from action script 2, and be able to
    reference/show the induividual frames for a video game and not a
    movie. I dont realy need animation, i just need certain frames to
    show, that i want to load load(from a non script made movie clip
    with one loaded frame(bitmap data).

    you can't add frames to a movieclip using actionscript. so,
    if that's what you're trying to do you'll need to find some other
    way to accomplish your goal.

  • New to AI and need help with individual images

    Hi,
    A client sent me her website mock up as an .eps file.  I can open that in Illustrator but I'm having a hard time "grabbing" the individual images and putting them into Fireworks and then ultimately they need to make their way to Dreamweaver (I know how to do that part!)
    Can I get some help on saving the individual images in the design so that I can use them again?
    Thanks
    Debi

    It's important to note you don't have to use any other app. But if you're unfamiliar with Ai, it may be easier.
    If you've got an item you can't seem to select in Ai you need to check if it's locked, the layer's panel should show a little lock next to any locked object. That's another one of those questions that's practically impossible to answer effectively without seeing the file.

Maybe you are looking for

  • Digital Audio output for W series - Alternatives

    There's a thread talking about the displayport does not have audio-output.  Its true and some people get victimized by ill-trained sales people who think their displayport is standard.  There's no literature on Lenovo website warning users about the

  • Upgrading ASA 5510 from 8.0.4 to 8.2.5

    We want to implement Netflow so want to upgrade our 5510 to 8.2.5. But have a few questions. This device has 64MB of flash and 256MB of DRAM. Would I need to upgrade RAM? Right now we have about 25 site to site VPNs running through this thing as well

  • How can i cancel a payment method

    Didnt work they put for me:this payment method is declined try another one. I put but the same

  • Can't see Computers/Servers in Finder on local ip network

    I'm trying to share some files between by Powerbook and iMac. Both are running Tiger. Both are configured with IP on the same subnet and can ping each other Both are using wifi as their network interface Both can get to the internet, iMac, iDisk fine

  • TDS Cert Break up not coming.

    Hi, While i am printing the tds certificate break up is not coming. means tds,surcharge,education cess its not showing the break up its showing the total tax deposited. Amount paid or credited also showing a less amount compared to total tax depostit