i don't know how to link classes together so i just used a method. The methos is called drawRectangle
Type: Posts; User: usherlad
i don't know how to link classes together so i just used a method. The methos is called drawRectangle
yeah sure. I know have a button that adds the brick instead of the brick being added straight away. Only reason for this is because it states that in the assignment criteria.
import...
I have finally managed to do it even though it may not be the correct way.
I have done it for a brick i know the location of but now i want to try and improve it by having a randomly displayed...
I have it stored as a method. How do i store it as a variable?
nothing but it was meant to run the removeRectangle method
Again nothing but i wanted it to be that if it was true then it wouldn't run the removeRectangle method
yeah i see what you...
ignore what i previously. I have wrote this at class level.
if ((x>=x1 && x<=x2) && (y==y1) && beenHit == false){
removeRectangle();
}else{
can i link a boolean and method together. For example:
Boolen BeenHit = false
.........
if false
drawRectangle()
else
Thank you for all your help today Norm. I have just managed to get my pictures to spin. Sorry again if i have been frustrating
Cheers
public void actionPerformed (ActionEvent event)
{
if(event.getSource()==btnBye){
JOptionPane.showMessageDialog(null,"Thank You For Playing....Bye!!!");
System.exit(0);
}
...
I have managed to merge the if statements so it looks more tidy.
I cant really make an array because i havnt learnt about these yet and its only testing us on what we have already learnt.
I...
yeah i would like the three image displays to do that. Just like the SpinSimulator.
oh i thought the coding for them was both the same and thought they would both have done that.
Could you...
on the SpinSimulator program, when you click the button "Spin", it flicks through three pictures giving the effect that its spinning. When you click the button "Play" on the ElectronicSlot8 program...
sorry i meant everything but the timer. I don't know whether im blind or what but im confused as to why the pictures dont act the same as the pictures do in the SpinSimulator program.
Yeah i have...
Everything works as how it should. I don't know whether the response i got from the timer was correct or not
i have tried what you said on timer and i got the following response:
javax.swing.Timer@a3bcc1
is that correct or not?
I have given up on the hold buttons for now cause they've been making...
No i havn't. Stupid question here but how do i do that?
sorry that there is alot of code in there.
the code that is meant to spin the pictures is:
if(event.getSource()==btnStart){
counter = 0;
timer = new Timer(100,this);
Sorry, the code i just posted was for the program that works. What the program does is what i would like my other program to do but for some reason that i dont know of it wont. Instead of showing...
i suppose so yeah. So it would flicker through each of the pictures eventually stopping on a random one
Like you see the reels spin on a fruit machine.
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
class SpinSimulator extends JFrame implements ActionListener{
private int...
Hi,
i have two programs where i want the pictures to spin. On one program the pictures spin and on the other they dont. The code is the same so im not sure whats going on.
Program where...
i have given it a try but i dont understand why it wont work. I have set a timer for each real and when the hold button is selected the timer stops so that reel doesnt spin. However the reel still...
Hi,
I'm trying to write the code for a hold button on a fruit machine. Im not sure where to start or how to do it.
Can anyone help me please and point me in the right direction
Thank You
sorry if all my questions are stupid but im just trying to find out.
is public static void main(String[] args) or public BouncingBall1(){ class level
so there is no way of linking the boolean in the moveBall method and the removeRectangle method?