This site requires JavaScript, please enable it in your browser!
Greenfoot back
Rudolf
Rudolf wrote ...

2014/3/26

Difference between Desktop&Menue

Rudolf Rudolf

2014/3/26

#
Hello, I got a Problem with my Programm. I don´t know how to differ my Menue and my Desktop. If I copy one Icon from my Menue to the Desktop, the new Icon shall not have the same options as the old one in the Menue. And it´s forbidden to drag the new Icon back in the Menue.
import greenfoot.*;  // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
import java.util.List;
import greenfoot.GreenfootImage.*;
import java.awt.*;
import java.awt.event.*;//Event brauchen wir für das Ereigniss, wenn ein Button geklickt wird
import java.awt.Color;
import java.lang.Object;
import javax.swing.*;

/**
 * Write a description of class Welt here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public class Welt extends World
{

    /**
     * Constructor for objects of class Welt.
     * 
     */
    public Welt()
    {    
        // Welterstellung mit 1116 x 624 pixel bei einer größe des Pixel von 1
        //super(916, 624, 1); 
        super (1116,624, 1, true);
        getBackground().drawImage(new GreenfootImage("Desktop.jpg"),2, 0);
        getBackground().drawImage(new GreenfootImage("Menue_bar.jpg"),0, 520); 
        getBackground().drawImage(new GreenfootImage("Computer_1.jpg"),265, 537);
        getBackground().drawLine(0, 520, 1116, 520);
       getBackground().setColor(Color.pink);
       /*JLabel label = new JLabel("Some text or Symbols");  
       label.addMouseListener(new MouseAdapter() {  
    @Override  
    public void mouseClicked(MouseEvent arg0) {  
        //this method will be executed when you click on the field.  
        //almost like buttons.  
        System.out.println("mouseEvent");  
    }  
     });*/
    }
     public Start start;   // definition start erstellt
    {
        start = new Start();
        addObject(start,70,570); //Start Button eingefügt bei Position x=70 x y=570
        
       
    }
    public Stop stop;
    {    
        stop = new Stop();
        addObject(stop,180,570); //Stop Button eingefügt bei Position x=70 x y=570
    }
    public Computer computer;
    {    
        computer = new Computer();
        addObject(computer,300,570); //Computer Button eingefügt bei Position x=300 x y=570
    }
    public Router router;
    {    
        router = new Router();
        addObject(router,390,570); //Router Button eingefügt bei Position x=390 x y=570
    }
    public Verbindung verbindung;
    {    
        verbindung = new Verbindung();
        addObject(verbindung,475,570); //Verbindung Button eingefügt bei Position x=480 x y=570
    }
    public Loeschen loeschen;
    {    
        loeschen = new Loeschen();
        addObject(loeschen,600,570); //Loeschen Button eingefügt bei Position x=585 x y=570
    }
    public Lupe lupe;           
    {    
        lupe = new Lupe();
        addObject(lupe,710,570); //Lupe Button eingefügt bei Position x=690 x y=570
    }     
    public Speichern speichern;
    {    
        speichern = new Speichern();
        addObject(speichern,820,570); //Speichern Button eingefügt bei Position x=300 x y=570
    }                    
    public Bibliothek bibliothek;
    {    
        bibliothek = new Bibliothek();
        addObject(bibliothek,930,570); //Bibliothek Button eingefügt bei Position x=300 x y=570
    }                
    public Zeiger zeiger;
    {    
        zeiger = new Zeiger();
        addObject(zeiger,1040,570); //Zeiger Button eingefügt bei Position x=300 x y=570
    }
}

Rudolf Rudolf

2014/3/26

#
Here my World with the Desktop and the Menu below.
You need to login to post a reply.