-
Using Blue J
hi everyone, i am a uni student who's just started java programming. at the moment we programme with the interface called BlueJ, i am not sure how many use this or have heard of it but i am having problems, i have got a list of excercises i have done some but i just cant... somebody help please
-
-
well i got this exercise to change a piece of code to make it do something else, and to also make that change a method, java is totally new to me so i am stuck
-
its meant to be really easy, but i am new at this and unfortunately its not sticking this is the code
Code:
public class Picture
{
private Square wall;
private Square window;
private Triangle roof;
private Circle sun;
public Picture()
{
public void draw()
{
wall = new Square();
wall.moveVertical(80);
wall.changeSize(100);
wall.makeVisible();
window = new Square();
window.changeColor("black");
window.moveHorizontal(20);
window.moveVertical(100);
window.makeVisible();
roof = new Triangle();
roof.changeSize(50, 140);
roof.moveHorizontal(60);
roof.moveVertical(70);
roof.makeVisible();
sun = new Circle();
sun.changeColor("blue");
sun.moveHorizontal(180);
sun.moveVertical(-10);
sun.changeSize(60);
sun.makeVisible();
}public void setBlackAndWhite()
{
if(wall != null)
{
wall.changeColor("black");
window.changeColor("white");
roof.changeColor("black");
sun.changeColor("black");
}
}
{
if(wall != null)
{
wall.changeColor("red");
window.changeColor("black");
roof.changeColor("green");
sun.changeColor("yellow");
}
}
}
as you can see all that does is display a picture in the blue j interface, i was meant to change the image so as the sun acts like a sunset, using the slowMoveVertical method, but i have tried to do it and still cant and when i achieve that i am meant to make it a method, its all confusing to me
[ArchAngel added CODE tags]
-
This code isn't that helpful as there are several classes whos definition we don't know: Square, Circle, Triangle etc. Please give definitions of these classes.
Also, where is the BlueJ picture loaded?
ArchAngel.
O:-)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks