Mike Meakin

Ranch Hand
+ Follow
since Dec 30, 2004
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Mike Meakin

Hi, I just need a quick piece of code, When frame3 appears there is a simple math question of 100 + 100 =. what I need is coding for Jbutton1 (submit answer) so that you can only move onto frame4 if the obvious answer of 200 is enterd into jTextField1. Heres the existing code it needs to fit into:


18 years ago
It needs to be like I'm doing it in my code, like this,Imagine frames:

Frame1: Enter Your Name
...............(jLabel1)
Continue (jbutton1)
|
|
Frame2: Welcome To Arithmetic Test
Select A Test
A. Addition (button1)
B. Subtraction (button2)
C. Division (button3)
D. Multiplication (button4)
|
|
|
Frame3: e.g 10 + 10 = (Jlabel for answer)

Submit(jButton1)

I've just started the first frame, its going to be quite a big project for me!
18 years ago
Ok here the first frame where you simply enter a username and press continue to go to the next frame. So I need some code just so you put your name in 'jTextField1' and press JButton1(continue) to bring you to the next frame. Heres the code so far:

[ June 15, 2005: Message edited by: Mike Meakin ]
18 years ago
This needs to be done in frames.
Create a simple arithmetic tester to practice students in simple arithmetic. The application should have an entry screen, where the user may login. On succesful login the screens should change to a choice screen where the user will be able to select an arithmetic test(addition, subtraction, multiplication, or division).
when undertaking a test , a running score should be maintained, with a final percentage mark being offerd on completion.
(I'll post my first attempt soon) Any suggestions would be great.
[ June 15, 2005: Message edited by: Mike ]
18 years ago
This is line 92/93:
frame.setLocation((d.width - frame.getSize().width)); / 2,
(d.height - frame.getSize() .height) /2));

Removing a ; does not solve the problem.
[ May 11, 2005: Message edited by: Michael Munro ]
18 years ago
Can anyone tell me why I have got these errors:

"Applet2.java": Error #: 204 : illegal start of expression at line 92, column 70
"Applet2.java": Error #: 206 : malformed expression at line 92, column 15

Heres the code:

18 years ago
I don't have a clue. All I need is a code which will make the square move around the applet and bounce off the walls, I don't have a clue where to start. Apart from drawing the square as in the code above.
18 years ago
I basically need the coding for all of this:

void moveSquare()
{
for loop change values of x and y
inside loop
call a method here that checks whether the square conincides
with any of the borders
if it does not then call repaint
if it does then change vx and vy according to the border it is
co-inciding with If it co=incides with top or bottom
border change value of vy to its reverse power(if its
positive make it negative and vice-versa)Left ot Right
Border change the vx value to its reverse.
}
18 years ago
Hi Java Geezers! Just wondering if anyone is able to help me with this:

"Write an applet that contains an 8 x 8 solid green square. The square is to move at a constant speed. It bounces off the boarders of the aplet display area when it comes into contact with them. Each time the square contacts the border its speed remains constant, but its velocity changes"

Well I've drawn the green square but I haven't a clue how to make it move, heres my code so far: Please help!
18 years ago
Iv'e don it now anyway:

int incY = 260/colours.length;
for (int i = 0; i < colours.length; i++)
{
bars.setColor(colours[i]);
bars.fillRect(0, i * incY, 260, (i + 1) * incY);



[ April 18, 2005: Message edited by: Michael Munro ]
18 years ago
Yes I can do most of that, I can drawArc, drawRect, drawOval and put the measuments in etc...
But there is no infomation there for what I need to do. The code I have above displays vertical bars I need to alter that so they display horizontally. Its not a draw." " type code.
18 years ago
Thats where the lines appear in the applet but it doesn't control if the go verticle or horizontal. at least I don't think they do.
18 years ago
Yes I undestand that, I think its the bit which has (graphics bars) in brackets, obviously the code needs to coorespond to that.
18 years ago
Thanks, but I'm not sure how to do that

[ April 17, 2005: Message edited by: Michael Munro ]
[ April 17, 2005: Message edited by: Michael Munro ]
18 years ago
Oh, I forgot to mention, I have been told: "Simply add the code as is, without import statements or a 'class', to the previously generated program, replacing the similary named method therein."

thats what it says in my text book, which just sounds confusing.
18 years ago