Results 1 to 2 of 2
Thread: Java boolean problem
- 04-04-2011, 11:44 AM #1
Member
- Join Date
- Apr 2011
- Posts
- 1
- Rep Power
- 0
Java boolean problem
Hello,
I'm new to java and this forum and I stumbled on this problem. It would be great if somebody could help me with this!:confused:
BTW i'm dutch and therefore the commands are in Dutch.
down here is my java logo program (and the error is under my program):
ERROR: (They refer to the Animatie segment)/*
* @(#)BalUitd.java 11/03/15
*
* JavaLogo Project
*
*/
import logotekenap.*;
public class BalUitd extends TekenApplet
{
double xverander;
double yverander;
double xstap;
double ystap;
int teller;
public void initialiseer()
{
maakTraceMogelijk();
maakAnimatieMogelijk();
xstap=0;
ystap=0;
xverander=1;
yverander=0.5;
}
public void tekenprogramma()
{
bal(xstap, ystap, "rood");
}
public void bal(double xstap, double ystap, String kleur)
{
pen.vooruit(ystap+yverander);
pen.rechts(90);
pen.vooruit(xstap+xverander);
pen.links(90);
pen.vulAan(kleur);
pen.vooruit((360*0.5)/(2*Math.PI));
pen.rechts(90);
int teller;
teller =0;
while (teller < 360)
{
pen.vooruit(0.4);
pen.rechts(1);
teller=teller+1;
}
pen.vulUit();
}
public void animatie(double xstap, double ystap, double xverander, double yverander)
{
while(animatieLopend())
{
if(xstap=300)
{
xverander=-xverander;
}
else if(xstap=-300)
{
xverander=-xverander;
}
else if(ystap=-300)
{
yverander=-yverander;
}
else if(ystap=300)
{
yverander=-yverander;
}
}
tekenOpnieuw();
}
}
THANKS!--------------------Configuration: BalUitd - j2sdk1.4.2_05 <Default> - <Default>--------------------
H:\MyProjects\BalUitd\BalUitd.java:133: incompatible types
found : double
required: boolean
if(xstap=300)
^
H:\MyProjects\BalUitd\BalUitd.java:138: incompatible types
found : double
required: boolean
else if(xstap=-300)
^
H:\MyProjects\BalUitd\BalUitd.java:143: incompatible types
found : double
required: boolean
else if(ystap=-300)
^
H:\MyProjects\BalUitd\BalUitd.java:148: incompatible types
found : double
required: boolean
else if(ystap=300)
^
4 errors
Process completed.
:):)
- 04-04-2011, 12:24 PM #2
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,406
- Blog Entries
- 7
- Rep Power
- 17
Similar Threads
-
problem on expressing a boolean method
By b.m in forum New To JavaReplies: 9Last Post: 12-12-2010, 06:17 PM -
What is the Java library method that takes String parameter and returns a Boolean?
By CaptainBlood in forum New To JavaReplies: 2Last Post: 10-15-2010, 05:09 AM -
boolean condition creating problem
By Basit781 in forum CLDC and MIDPReplies: 1Last Post: 05-25-2010, 07:57 AM -
use boolean as 0 or 1
By joost_m in forum New To JavaReplies: 10Last Post: 04-13-2010, 11:22 AM -
[SOLVED] boolean method problem
By shadowblade19 in forum New To JavaReplies: 6Last Post: 11-30-2008, 02:01 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks