I am at a lost....Can some please help! Code included

This is a sample of my code.
I keep getting this error but can't figure out why. I am using JGrasp to compile.
Link.java:38: elementAt(int) in java.util.Vector cannot be applied to (double)
          ProgramListener pl = (ProgramListener) v.elementAt(i);
import java.util.*;
import java.lang.Character;
public class Link implements Runnable
     Vector v=new Vector();
     Thread thread;
     public Link()
            thread=new Thread(this);
            thread.start();
     public void run()
        while(globalVariables.CurrentStockPrice != globalVariables.SetStockPrice)
             triggerEvent();
           try
                thread.sleep(1000);
               catch (Exception e){}                       
     public synchronized void addProgramListener (ProgramListener l)
          v.addElement (l);
     void triggerEvent()
          ProgramEvents pe=new ProgramEvents (this);
          for(double i=0.00; i<v.size(); i++){
          ProgramListener pl = (ProgramListener) v.elementAt(i);
          pl.handleEvent(pe);     
[/code}
Any help would be appreciated :)

Is there any specific reason you are using double here
          ProgramEvents pe=new ProgramEvents (this);
          for(double i=0.00; i<v.size(); i++){replace double with int

Similar Messages

  • Hello can some please help I am trying to watch my HBO go on my apple tv I have sound not picture. I can watch my iTunes videos and youtube so I know it works. it is working

    Hello can some please help I am trying to watch my HBO go on my apple tv I have sound no picture. I can watch my iTunes videos and youtube on my airplay with my ipad and everything is updated so I know it works. But not on HBO go, Max go, showtime go.

    What you want to do does not work with an iPd running iOS 5. See the screenshot.
    The latest update for HBO GO does allow for AirPlay on Apple TV - sound and video - but only on devices running iOS 6 and Apple TV running 5.1.1 or later - according to the app description.

  • HT204380 My husband and I were trying to setup FaceTime and now his cellphone number is on my FaceTime setting instead of mine and I'm receiving his text messages. Can some please help .

    My husband and I were trying to setup FaceTime and now his cellphone number is on my FaceTime setting instead of mine and I'm receiving his text messages. Can some please help .

    On each device, go to Settings > Messages > Send & Receive.  Make sure that each device is using separate addresses and phone numbers.  If your email address is checked on both devices, Your husband will recieve everything he intends to send to you.
    Do the same for FaceTime.

  • I renew my itunes match and all the old information was lost can some body help me ?

    i renew my i tunes match and all the old information was lost can some body help me ?
    a few month ago i had all my songs on the cloud with i tunes match
    than apple has change their policy and they wanted 24.99 for a year
    after two month i renew my i tunes match but all my information was lost and now i cant play and sync all the music a had
    any body had this problem ?  any body solved it ?

    Greetings yoavfromseattle,
    Welcome to the Apple Support Communities!
    I understand that after renewing your iTunes Match subscription, you are not able to access your music as you would expect. To troubleshoot this situation, I would recommend reading over and working through the information in the attached article. 
    How to troubleshoot iTunes Match - Apple Support
    Cheers,
    Joe

  • Totally lost - can anyone please help?

    Hi,
    Can anyone please help with the following...
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.event.ActionListener;
    public class project
        public static void main(String[] args)
         //   Time time = new Time();
         //   System.out.println(time.getTime());
        right r = new right();
        left l = new left();
        JPanel p = new JPanel();       
        JPanel p2 = new JPanel(); 
        JPanel p3 = new JPanel();  
        JFrame aFrame = new JFrame();
        aFrame.setTitle("Swing 3");
        aFrame.setBounds(0, 0, 700, 500);
        Container contentPane = aFrame.getContentPane();
         //  add(new left());
         //       add(new right());
         //p.add(new left());
         //p.add(new right());
         r.textArea.setText("Red");
       p.add(l);
       p.add(r);
       p3.add(p);
       ///p3.add(p2);
       contentPane.add(p3);
       aFrame.setVisible(true);
    ===================================
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.event.ActionListener;
    public class left extends JPanel implements ActionListener
       public JButton redButton,greenButton,blueButton,yellowButton;   
       public left()
          JPanel pp = new JPanel();
          setLayout(new BorderLayout());
          redButton = new JButton("Red");
          redButton.addActionListener(this); // step 4
          greenButton = new JButton("Green");
          greenButton.addActionListener(this);
          blueButton = new JButton("Blue");
          blueButton.addActionListener(this);
          yellowButton = new JButton("Yellow");
          yellowButton.addActionListener(this);
          pp.add(redButton);
          pp.add(greenButton);
          pp.add(blueButton);
          pp.add(yellowButton);
          add(pp,BorderLayout.NORTH);
       public void actionPerformed(ActionEvent e)
           // e.getSource()  // returns name of the button
            if (e.getSource() == redButton){
               // r.setT("red");
                        System.out.println("red button");
            if (e.getSource() == greenButton)
              //r.textArea.setText("green");
                    System.out.println("green button");
            if (e.getSource() == blueButton)
              //r.textArea.setText("blue");
                    System.out.println("blue button");
            if (e.getSource() == yellowButton)
               // r.textArea.setText("yellow");
                        System.out.println("yellow button");
    ===================================
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.event.ActionListener;
    public class right extends JPanel
       JButton oneButton,twoButton;
       public JTextArea textArea;
       public right()
           JPanel jp = new JPanel();
           setLayout(new BorderLayout());
           oneButton = new JButton("one");
           twoButton = new JButton("two");
           textArea = new JTextArea();
           jp.add(oneButton);
           jp.add(twoButton);
           add(jp,BorderLayout.SOUTH);
           add(textArea,BorderLayout.NORTH);
    }In the left class I want to be able to click a button and then display a message in the JTextArea. I want main to be global - so the r object can be accessed anywhere.
    If anyone could get this to work I'd be really grateful.

    import java.awt.*;
    import java.awt.event.*;
    import java.awt.event.ActionListener;
    import javax.swing.*;
    public class ProjectRx
        public static void main(String[] args)
            // For the buttons in left to set text in the textArea
            // in right the two classes must communicate in some way.
            // Left must have a way to talk to right.
            // Option 1:
            //     Pass a reference to right to left which left can use
            //     to access the textArea in right.
            ProjectRightRx r = new ProjectRightRx();
            r.textArea.setText("Red");
            ProjectLeftRx l = new ProjectLeftRx(r);
            // Option 2:
            //     You could send a reference to the textArea to left
            //     instead of the reference to its enclosing class.
            //r.textArea.setText("Red");
            //ProjectLeftRx l = new ProjectLeftRx(r.textArea);
            JFrame aFrame = new JFrame();
            aFrame.setTitle("Swing 3");
            aFrame.setSize(400, 400);
            aFrame.setLocation(100,100);
            Container contentPane = aFrame.getContentPane();
            contentPane.add(r, "First");
            contentPane.add(l, "Last");
            aFrame.setVisible(true);
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.event.ActionListener;
    import javax.swing.*;
    public class ProjectLeftRx extends JPanel implements ActionListener
        ProjectRightRx r;
        public JButton redButton,greenButton,blueButton,yellowButton;   
        public ProjectLeftRx(ProjectRightRx r)
            this.r = r;
            JPanel pp = new JPanel();
            pp.setBorder(BorderFactory.createTitledBorder("Left"));
            setLayout(new BorderLayout());
            redButton = new JButton("Red");
            redButton.addActionListener(this); // step 4
            greenButton = new JButton("Green");
            greenButton.addActionListener(this);
            blueButton = new JButton("Blue");
            blueButton.addActionListener(this);
            yellowButton = new JButton("Yellow");
            yellowButton.addActionListener(this);
            pp.add(redButton);
            pp.add(greenButton);
            pp.add(blueButton);
            pp.add(yellowButton);
            add(pp,BorderLayout.NORTH);
        public void actionPerformed(ActionEvent e)
            // e.getSource()   returns object that generated this event
            // To get the name of the button you can try:
            JButton button = (JButton)e.getSource();
            String name = button.getActionCommand();  // or,
                          // button.getText();
            String ac = e.getActionCommand();
            System.out.println("name = " + name + "  ac = " + ac);
            if (e.getSource() == redButton){
    //            r.setT("red");
                System.out.println("red button");
            if (e.getSource() == greenButton)
                r.textArea.setText("green");
                System.out.println("green button");
            if (e.getSource() == blueButton)
                r.textArea.setText("blue");
                System.out.println("blue button");
            if (e.getSource() == yellowButton)
                r.textArea.setText("yellow");
                System.out.println("yellow button");
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.event.ActionListener;
    import javax.swing.*;
    public class ProjectRightRx extends JPanel
       JButton oneButton,twoButton;
       public JTextArea textArea;
       public ProjectRightRx()
           JPanel jp = new JPanel();
           setLayout(new BorderLayout());
           oneButton = new JButton("one");
           twoButton = new JButton("two");
           textArea = new JTextArea(10,25);
           jp.add(oneButton);
           jp.add(twoButton);
           add(new JLabel("Right", JLabel.CENTER), BorderLayout.NORTH);
           add(jp,BorderLayout.SOUTH);
           add(textArea,BorderLayout.CENTER);
    }

  • HT4623 Hi all, I have just lost  last month's notes about 15 pages of information.erything just disappeared . Can  some please help? Unfortunately I did not add the notes in the iCloud

    HI all,  I have just lost all of a month's notes on my iPad . I did not delete it, it just disappeared, unfortunately I did not add notes to my iCloud , can any body help? Has it happen to anyone else before?

    Hi Suns_Corona,
    Thank you for visiting the HP Support Forums and Welcome. I have read your thread on your HP Pavilion dv6 Notebook and forgot your password to fingerprint scanner. Here is a link to troubleshoot the fingerprint scanner password. Before troubleshooting make sure you clean the fingerprinter scanner.
    Hope it helps.
    Thanks.
    Please click “Accept as Solution ” if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos, Thumbs Up" on the bottom to say “Thanks” for helping!

  • Need help with reinstall of photoshop elements 10 premier. can some please help me

    just installed photoshop elements premier 10 to my computer after hard drive replaced. i cannot get it to set up for me, nor place an icon on the desktop. please help, i have no computer knowledge left in my itty bitty brain. HELP

    did it install ok?
    what os?

  • MSI (ALL IN ONE) MODEL 22XX CAN SOME PLEASE HELP, RECOVERY DISCS NEEDED

    hi i just bought a MSI ea2260 006uk off somebody manual calls it a wind top series,
    but it has windows 8 installed instead of the windows 7
    so what it looks like has happened is the person who installed the windows 8
    firstly not made a set of recovery discs and 2, has formatted the hard drive before hand so recovery sector has been deleted
    and i dont seem to have much software on there to work all the AIO to its max
    like there is no tv tuner software etc... but i have the tv aerial
    there is also no dvd playing software and has blue ray drive etc etc etc.....
    is there any body out there with the same or similar machine that is prepared to burn me off a copy of their recovery discs
    that way i can get the machine back to how it should be
    as i want to use it as a full media station,
    i know that while booting up you should press f3 to get into the recovery menu but it just boots to windows
    f11 does allow me to change boot up sequence etc...
    i do have a disc with it but it only has drivers on it and no software etc....
    i also have the manual and the windows COA sticker with number is on the back on the machine
    so please please can somebody help me,
    i will be willing to pay for any discs and 
    i have tried eBay but to no avail
    even if your model isn't identical they still could work
    and if any of you aint backed up your discs, make sure you do cos if you hdd buggers then you buggered too...
    any help will be greatly appreciated
    there is an small mini Aeriel  socket on the back of the all in one touchscreen PC and an Aeriel was also supplied with it
    so im assuming there is a tv card in there as it has all the option extras in the manual like sata connection, hdmi, remote control etc....
    also if peeps can tell me what softaware is on their 22xx series one that may be a big help too
    many thanks scott 

    Are you able to start in Recovery mode ?.   OS X: About OS X Recovery
    If so, then after the language choice screen, click Utilities at the top of the screen & choose Terminal.
    Once Terminal opens, type resetpassword  then press the enter key.
    Choose your user from the list & follow the prompts to create a new password. Then restart the computer normally.
    This won't allow you to update app store apps which the previous owner bought, but will let you install new software.
    Ideally, you'd erase the HD & reinstall OS X yourself : you may be able to do that from Internet Recovery, but may need original install DVDs,
    which Apple will usually supply for a small charge, if you call them with the serial number.
    Computers that can be upgraded to use OS X Internet Recovery

  • TS1398 I try to open my email but I keep getting cannot connect to server can some please help or should I go to apple store for help?

    I'm trying to open my email but I keep getting cannot connect to server! Can someone help me or should I just go to an apple store?

    Try This...
    Close All Open Apps... Sign Out of your Account... Perform a Reset... Try again...
    Reset  ( No Data will be Lost )
    Press and Hold the Sleep/Wake Button and the Home Button at the Same Time...
    Wait for the Apple logo to Appear...
    Usually takes about 15 - 20 Seconds... (But can take Longer..)
    Release the Buttons...
    More >  http://www.apple.com/support/ipad/mail/

  • Could some please help me i do not have a iphoto i have photos that have been downloaded but i cant do anything with them can some please help

    hello i am very new to apple ,but i,m a little frustrated as  for one thing i dont have iphoto so i cannot work or print photos also i have a applebook pro and whith that i have bought a pre paid mobilebroad band usb the booklet says it is compatable with apple mac, i follow the directions and still i can not get on the net also where do i find the file manager as this is what i need to set it up

    Marie,
    iPhoto is available for download from the App Store for $14.99.
    A free photo editing app called Picasa is available from Google HERE.
    The "file manager" on a Mac is called the Finder.  A finder window may be opened by clicking on the Finder icon on the dock.
    Or click on the desktop then got to the Finder menu on the top of the screen and select File - New Finder Window.
    You may want to repost your mobile boradband question as a stand alone question.  You may find someone who can answer that one.
    Dan

  • Incompatibe type error can some please help stuck in rut

    found : double
    required: javax.swing.JTextField
    TotalIncomeField = (num1 + num2 + num3);
    try {
    double num1 = Double.parseDouble(LoansField.getText());
    double num2 = Double.parseDouble(WagesField.getText());
    double num3 = Double.parseDouble(OtherField.getText());
    double num4 = Double.parseDouble(RentField.getText());
    double num5 = Double.parseDouble(FoodField.getText());
    double num6 = Double.parseDouble(OtherField2.getText());
    String op1 = (String)LoanComboBox.getSelectedItem();
    String op2 = (String)WagesComboBox.getSelectedItem();
    String op3 = (String)OtherComboBox.getSelectedItem();
    String op4 = (String)RentComboBox.getSelectedItem();
    String op5 = (String)FoodComboBox.getSelectedItem();
    String op6 = (String)Other2ComboBox.getSelectedItem();
    //Below I am adding the loans, wages & other field so that it total correctly incompatible type error found below (1).
    (1) TotalIncomeField = (num1 + num2 + num3);
    (2) TotalSpendingField = (num4 + num5 + num6);
    //Here above I am adding the rent, food & other field so that it total correctly incompatible type error found above (2)
    double result = 0;
    if (op1.equals("Weekly"))
    result = num1 * 4.3333333;
    else if (op1.equals("Monthly"))
    result = num1;
    else if (op1.equals("Yearly"))
    result = num1 / 12;
    else if
    (op2.equals("Weekly"))
    result = num2 * 4.3333333;
    else if (op2.equals("Monthly"))
    result = num2;
    else if (op2.equals("Yearly"))
    result = num2 / 12;
    else if
    (op3.equals("Weekly"))
    result = num3 * 4.3333333;
    else if (op3.equals("Monthly"))
    result = num3;
    else if (op3.equals("Yearly"))
    result = num3 / 12;
    TotalIncomeField.setText(String.format("%.2f",result));
    if
    (op4.equals("Weekly"))
    result = num4 * 4.3333333;
    else if (op4.equals("Monthly"))
    result = num4;
    else if (op4.equals("Yearly"))
    result = num4 / 12;
    else if
    (op5.equals("Weekly"))
    result = num5 * 4.3333333;
    else if (op5.equals("Monthly"))
    result = num5;
    else if (op5.equals("Yearly"))
    result = num5 / 12;
    else if
    (op6.equals("Weekly"))
    result = num6 * 4.3333333;
    else if (op6.equals("Monthly"))
    result = num6;
    else if (op6.equals("Yearly"))
    result = num6 / 12;
    TotalSpendingField.setText(String.format("%.2f",result));
    } catch (NumberFormatException ex) {
    }

    TotalIncomeField is a JTextField object reference, not a numeric value holder. What you may want is to put the string representation of the calculation into the CONTENTS of the JTextField. There is a setText method for that.
    TotalIncomeField.setText(theText);
    I'll assume you can work out how to turn the calculation into a string representing that calculation.
    SIGH SIGH SIGH
    Thanks for CROSSPOSTING this, you dolt.
    http://forum.java.sun.com/thread.jspa?threadID=780703

  • Can some please help me with the Wireless LAN Connection Configuration?

    I want to configure WLC in my Testing Lab , need help with the step by step configuration of WLC.

    Please go through the below link for the Basic Wireless LAN Connection Configuration Example.
    The below link has  end – end configuration steps with the images.
    http://www.cisco.com/c/en/us/support/docs/wireless-mobility/wireless-lan-wlan/68005-wlan-connect.html
    Have i answered for your query.

  • Can Someone Please Help with Email Setup!

    I know it maybe a sin, but I have a hotmail account, I been trying to on my Iphone. It doesn't seem to be working, can some please help me out

    you cant set it up in your mail app on your iphone to my understanding... Microsoft did not make this easy, since it needs a plug in on your computer to work and does not use standard pop3 protocals. Blame Microsoft not Apple on this one
    My suggestion
    Bookmark and use http://mobile.live.com to check your Hotmail account, it is designed for mobile phones and loads quick

  • I recently have ipad but before i sell it i made a back up of it and by an iphone when i put all the date on my iphone some files and software did not install is there anything i can do to recover the lost data? please help

    i recently have ipad but before i sell it i made a back up of it and by an iphone when i put all the date on my iphone some files and software did not install is there anything i can do to recover the lost data? please help

    I don't think you're on iOS 5, I think you're using iOS 6.  That's the latest version.
    Unless you've used iCloud to back up your documents, you won't be able to restore them.  And for future reference, you don't have to uninstall Pages to update your iPad anymore.  Sorry about this.

  • Can someone please help a friend of mine get a permanent registration key (not a trial key that expires in 30 days) to replace his lost registration key for Adobe Photoshop CS2? His previous hard drive crashed and he no longer has his registration key. Th

    Can someone please help a friend of mine get a permanent registration key (not a trial key that expires in 30 days) to replace his lost registration key for Adobe Photoshop CS2? His previous hard drive crashed and he no longer has his registration key. This is vital for his wedding business.

    Thanks to everyone for the tips on my CS2 question. It turns out in the end it was some plug-in filter software that was causing the glitch, not a lack of an Adobe registration key. As for why he still uses CS2, it does the job for him, so that's all he needs.

Maybe you are looking for