Search:

Type: Posts; User: LovellHoliday

Search: Search took 0.08 seconds.

  1. Replies
    40
    Views
    2,772

    Re: Help with racecar applet?

    i did, and i got it working now. but do you know how to add music files to a java applet? i have the code and everything working now, thanks to your assistance and some critical thinking, but i need...
  2. Replies
    40
    Views
    2,772

    Re: Help with racecar applet?

    the timer doesn't start until the button is clicked, right? and yes i dont get the null error or any other exception now, the only problems im having is:
    a) trying to get the images to start back at...
  3. Replies
    40
    Views
    2,772

    Re: Help with racecar applet?

    i moved the code that i had up there to the TimerHandler:


    //this is the code for my timer in the init:
    timer1 = new Timer(50, new TimerHandler());

    //this code is for my timer to work...
  4. Replies
    40
    Views
    2,772

    Re: Help with racecar applet?

    would the:


    String text1 = one.getText();
    int Car1 = Integer.parseInt(text1);

    be assigning it a value? i was giving it the text of the JTextField. the problem i guess is that until the app...
  5. Replies
    40
    Views
    2,772

    Re: Help with racecar applet?

    i was trying to set the value of text1 up with the text of the JTextField, and was gonna use the text in an Integer.parseInt for the Car1. i never declared text1 as null or any of that.
  6. Replies
    40
    Views
    2,772

    Re: Help with racecar applet?

    that's what im wondering. the line 72 in my code is:
    [CODE]
    Car1 = Integer.parseInt(text1);

    [\CODE]
    it seems to not want to do anything with turning the text into an int.
  7. Replies
    40
    Views
    2,772

    Re: Help with racecar applet?

    this is the new error im getting:


    java.lang.NumberFormatException: null
    at java.lang.Integer.parseInt(Integer.java:417)
    at java.lang.Integer.parseInt(Integer.java:499)
    ...
  8. Replies
    40
    Views
    2,772

    Re: Help with racecar applet?

    Is there a way i could use my textfield text(for example: 25 is entered) to change the speeds for my pictures instead of making them all go the same speed? also a way to change the text into an int,...
  9. Replies
    40
    Views
    2,772

    Re: Help with racecar applet?

    the variable was basically all the JTextFields, one, two, three, and four. something about turning the text inside them into the int Car1 made my program quite angry.
    This is the code for my...
  10. Replies
    40
    Views
    2,772

    Re: Help with racecar applet?

    i took out some program:
    [CODE]
    Car1 = Integer.parseInt(one.getText());
    Car2 = Integer.parseInt(two.getText());
    Car3 = Integer.parseInt(three.getText());
    Car4 =...
  11. Replies
    40
    Views
    2,772

    Re: Help with racecar applet?

    i got problem handled now. the only error im running into is when i run my program, i get this error whenever i press the button linked to the start timer:
    [CODE]
    Exception in thread...
  12. Replies
    40
    Views
    2,772

    Re: Help with racecar applet?

    Ok i did it like you posted, and got this now


    big=javax.swing.JPanel[,0,0,0x0,invalid,layout=java.awt.FlowLayout,alignmentX=0....
  13. Replies
    40
    Views
    2,772

    Re: Help with racecar applet?

    big.add(one);
    java.lang.NullPointerException
    at java.awt.Container.addImpl(Container.java:1045)
    at java.awt.Container.add(Container.java:365)
    at...
  14. Replies
    40
    Views
    2,772

    Re: Help with racecar applet?

    How do i add a println? i did a System.out.println() over the whole line but then it skipped to line 92 and so on and so on lol. it's really frustrating as i've never seen this error before.
  15. Replies
    40
    Views
    2,772

    Re: Help with racecar applet?

    I've recently run into a new problem, am on break from school but have to have this done by next Tuesday. I've gotten a lot done, but a new problem has arrisen. this is my full code:


    import...
  16. Replies
    40
    Views
    2,772

    Re: Help with racecar applet?

    g.drawImage(iron, a, 100 100, 100, this);
    g.drawImage(exp, 100, 100, 500, 500, this);
    g.drawImage(hulk, b, 100, 100, 100 this);
    g.drawImage(thor, c, 100, 100, 100, this);
    g.drawImage(cap, d, 100,...
  17. Replies
    40
    Views
    2,772

    Re: Help with racecar applet?

    click.addActionListener(new ActionListener() {

    public void actionPerformed(ActionEvent e)
    {

    timer1.start();
    }

    });
    I have an action listener connected to my button, so when it's clicked...
  18. Replies
    40
    Views
    2,772

    Re: Help with racecar applet?

    superclass.java:84: addActionListener(java.awt.event.ActionListener) in java.swing.AbstractButton cannot be applied to (superclass)
    click.addActionListener(this);

    Ok I got that settled and for...
  19. Replies
    40
    Views
    2,772

    Re: Help with racecar applet?

    I worked out some of the kinks and this is what i have working for right here:


    import javax.swing.JApplet;
    import java.awt.Graphics;
    import javax.swing.JTextField;
    import javax.swing.Timer;...
  20. Replies
    40
    Views
    2,772

    Help with racecar applet?

    Im making a racecar app for my java class for a final exam grade, and i am rushing to get this done, but want it to work well. i consulted my teacher in class and she said that i would need to change...
  21. Replies
    40
    Views
    2,772

    Help with racecar applet?

    I am creating a racecar/moving pictures app for my Java class project, and am on a good track, have recently came into some very helpful information from some classmates finished with their projects...
Results 1 to 21 of 21