I programmed a "World". It is made of JLabels in a JFrame. The Labels are saved in class called Field. The Fields are saved in a two dimensional array in the world (the JFrame). That way you can get every JLabel to set Text on it. Everything worked very well. I have made a class named Entity which is equal to Actor (not so far, but I think what you mean). I put one Entity in the world. The Entities have images of two dimensional character arrays, but ther is only one so far, which looks like this:
ABC
DEF
GHI
The images are a class called charImage (like GreenfootImage). The main method of the world looks like this:
The run method of the world calls the run methods of all entities in the world. As you can see I've put one entity to 10/10 (the JLabels are scaled 10x10 px). The run method of Entity is this one:
So the entity moves to the right end and then the whole execution stops. I started it and everything worked. My abcdefg (scaled in a block) has moved slowly to the right and then it has ended. But then it didn't work anymore.
That means, that you can't see anything. The JFrame opened, but there was only the default grey. After waiting I noticed, that the entity moves still because the programm ended after the expected time. Then I checked nearly all methods by commenting if clauses or method calls.
First I thought it would be a failure in my draw method, which draws the entity into the world, but actually I hadn't changed anything since it has worked very well. After checking I came to the conclusion that the mistake is, that the JLabels don't display their text anymore. Thinking there is a bug in Java might be arrogant, but as I erased the placing of the entity in main and the run and only said to one JLabel, that it should display "H", but it didn't.
Thanks to all, who have read this and thanks to all, who are able to help me.
If you want I can post more of the code. It isn't much so far.
public static void main(String[] args){
World w = new World();
w.randomizeImage();
w.addObject(new Entity(), 10, 10);
while(!w.STOP){
w.run();
help.warte(200);
}
System.exit(0);
}public void run(){
setLocation(getX()+1, getY());
if(getX()>getWorld().getWidth()-2)
getWorld().stop();
}


