Trabalho com Animação e Labirinto

1 resposta
I

olá pessoal to fazendo um trabalho final para a faculdade tenho alguns códigos prontos aki mas está dando alguns erros ainda e não sei o que é que está errado.
o rabalho consiste em criar uma animaçao onde tem um labirinto e um robô e tenho que criar formas de o robô andar pelo labirinto.
quando mando compilar aparece a imagem do robô e um quadrado todo escuro(é pra ser o labirinto) então naõ consigo visualizar o labirinto só esse quadrado escuro e o robô andando por esse quadrado.
acontece o seguinte erro:

Exception in thread AWT-EventQueue-0 java.lang.IllegalArgumentException: Width (-1) and height (-1) cannot be <= 0

at java.awt.image.DirectColorModel.createCompatibleWritableRaster(Unknown Source)

at java.awt.image.BufferedImage.(Unknown Source)

at trabalhoFinal.ImageUtilities.getBufferedImage(ImageUtilities.java:26)

at trabalhoFinal.PainelAnimado.paintComponent(PainelAnimado.java:71)

at javax.swing.JComponent.paint(Unknown Source)

at javax.swing.JComponent.paintChildren(Unknown Source)

at javax.swing.JComponent.paint(Unknown Source)

at javax.swing.JComponent.paintChildren(Unknown Source)

at javax.swing.JComponent.paint(Unknown Source)

at javax.swing.JLayeredPane.paint(Unknown Source)

at javax.swing.JComponent.paintChildren(Unknown Source)

at javax.swing.JComponent.paintToOffscreen(Unknown Source)

at javax.swing.BufferStrategyPaintManager.paint(Unknown Source)

at javax.swing.RepaintManager.paint(Unknown Source)

at javax.swing.JComponent.paint(Unknown Source)

at java.awt.GraphicsCallback$PaintCallback.run(Unknown Source)

at sun.awt.SunGraphicsCallback.runOneComponent(Unknown Source)

at sun.awt.SunGraphicsCallback.runComponents(Unknown Source)

at java.awt.Container.paint(Unknown Source)

at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)

at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)

at javax.swing.RepaintManager.seqPaintDirtyRegions(Unknown Source)

at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(Unknown Source)

at java.awt.event.InvocationEvent.dispatch(Unknown Source)

at java.awt.EventQueue.dispatchEvent(Unknown Source)

at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)

at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)

at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)

at java.awt.EventDispatchThread.pumpEvents(Unknown Source)

at java.awt.EventDispatchThread.pumpEvents(Unknown Source)

at java.awt.EventDispatchThread.run(Unknown Source)

dá para explicar mais ou menos o que quer dizer isso? :smiley:
desde já obrigado

1 Resposta

rodrigo.bossini

Width (-1) and height (-1) cannot be <= 0

Isso aparentemente quer dizer que você está tentando fazer seu robô acessar uma posição (-1,-1) que não existe na tela.

Criado 8 de junho de 2010
Ultima resposta 8 de jun. de 2010
Respostas 1
Participantes 2