Using Blue J


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 5 of 5

Thread: Using Blue J

  1. #1
    Join Date
    Oct 2003
    Posts
    21

    Question 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

  2. #2
    Join Date
    Mar 2003
    Posts
    834
    What's the problem?
    ArchAngel.
    O:-)

  3. #3
    Join Date
    Oct 2003
    Posts
    21
    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

  4. #4
    Join Date
    Oct 2003
    Posts
    21
    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]

  5. #5
    Join Date
    Mar 2003
    Posts
    834
    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
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center