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

2011/7/12

Bug in Greenfoot?- Problem with .jar

1
2
GameCode GameCode

2011/7/12

#
Nearly everytime I create a .jar-file of my Greenfoot projects, there is a little black square instead of my game. When I click on 'Reset' my game appears but you can't play it because the jar window is too small. You could see this square for example on my frog scenario ( http://greenfootgallery.org/scenarios/3206 ) When you click 'Reset' it works, because on the website the window has the right size. Does anyone noticed the same thing on his scenarios? Could any one help me?
MrIncredible MrIncredible

2011/8/5

#
I got the same problem. Always i have to use HTML's! please anwser! MrIncredible
mjrb4 mjrb4

2011/8/6

#
Is this just when you create a jar and not otherwise? Are you sure it's not an exception occuring in your code causing the issue (have a look at the Java console?) I've just thrown together a quick simple scenario, exported it to a jar and it seems to work fine.
MrIncredible MrIncredible

2011/8/6

#
Hi, In Greenfoot it works fine, but in Jar and Html there is the square. In the HTML i can click RESET and then it works, but not in the JAR. MrIncredible
mjrb4 mjrb4

2011/8/6

#
As above, have you checked the Java console for errors?
MrIncredible MrIncredible

2011/8/6

#
Yes, of course. Its very mysterious, isnt it ? MrIncredible
mjrb4 mjrb4

2011/8/6

#
Have you tried clearing out your Java cache? And could you point to a scenario I could download (the one originally posted doesn't seem to allow downloads) that demonstrates the problem?
MrIncredible MrIncredible

2011/8/6

#
Sorry for this question: How to clear out Java Chache ? I dont know what i did wrong ! :-( MrIncredible
mjrb4 mjrb4

2011/8/6

#
Are you running windows? If so see here: http://www.java.com/en/download/help/plugin_cache.xml
davmac davmac

2011/8/6

#
There are a couple of bugs in Greenfoot 2.1.0 that can cause this (they'll be fixed in the next release). For instance it can happen if you call Greenfoot.getKey() or similary from the world's constructor.
MrIncredible MrIncredible

2011/8/6

#

Thanks to mjrb4

I publish it for all :

If you wanna see pictures klick here !

How do I clear the Java cache? This article applies to: Platform(s): Windows 7, Vista, Windows XP, Windows 2000, Windows 2003, Windows ME, Windows 98 Java version(s): 6.0, 6u10+ Clearing the Java Plug-in cache forces the browser to load the latest versions of web pages and programs. To clear the Java Plug-in cache: Click Start > Control Panel. Double-click the Java icon in the control panel. The Java Control Panel appears. Java Control Panel Click Settings under Temporary Internet Files. The Temporary Files Settings dialog box appears. Temporary Files Settings dialog box Click Delete Files. The Delete Temporary Files dialog box appears. Delete Temporary Files dialog box Click OK on Delete Temporary Files window. Note: This deletes all the Downloaded Applications and Applets from the cache. Click OK on Temporary Files Settings window. Note: If you want to delete a specific application and applet from the cache, click on View Application and View Applet options respectively.

Mr Incredible

MrIncredible MrIncredible

2011/8/6

#

When does the next release come ?

MrIncredible

Busch2207 Busch2207

2011/8/8

#
I had this problem once! But I found the Problem. Maybe you've got the same. First I wrote:
        private Computer []Player = {new Computer(0,this,false), new Computer(1,this,true), new Computer(2,this,true), new Computer(3,this,true)};

public world()
{
        super(800,700,2000,1300, 1/*,false*/);
        [...]
        Player[0].setColor(new Color(0,125,0));
        Player[1].setColor(Color.blue);
        Player[2].setColor(Color.red);
        Player[3].setColor(Color.yellow);
        [...]
    }
Then I found the mistake and wrote:
        private Computer []Player;

public world()
{
        super(800,700,2000,1300, 1/*,false*/);
        [...]
        Player = new Computer[]{new Computer(0,this,false), new Computer(1,this,true), new Computer(2,this,true), new Computer(3,this,true)};
        Player[0].setColor(new Color(0,125,0));
        Player[1].setColor(Color.blue);
        Player[2].setColor(Color.red);
        Player[3].setColor(Color.yellow);
        [...]
    }
and the problem had been solved... :)
MrIncredible MrIncredible

2011/8/8

#
Ahh, That can be the mistake thanks ! I'll try to change it. But I have another question to you:
Busch2207 wrote...
super(800,700,2000,1300,1/*false*/);
I write, only:
super(780,640,1);
MrIncredible
Busch2207 Busch2207

2011/8/8

#
The world-class, where this code is written, is a subclass of a scrollworld class, I wrote... and there I need another constructor to create the scrollworld... x)
There are more replies on the next page.
1
2