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...
Type: Posts; User: LovellHoliday
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...
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...
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...
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...
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.
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.
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)
...
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,...
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...
i took out some program:
[CODE]
Car1 = Integer.parseInt(one.getText());
Car2 = Integer.parseInt(two.getText());
Car3 = Integer.parseInt(three.getText());
Car4 =...
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...
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....
big.add(one);
java.lang.NullPointerException
at java.awt.Container.addImpl(Container.java:1045)
at java.awt.Container.add(Container.java:365)
at...
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.
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...
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,...
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...
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...
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;...
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...
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...