Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

sliding puzzle help

 
peter petros
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I want to make an applet game like this on url :


webpage

Could someone help me please ???

I am trying to write code but I don;t know good java.
My code is :



thanks a lot
 
Paul Clapham
Sheriff
Posts: 21567
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In general I would recommend not mixing AWT components (e.g. Applet) with Swing components (e.g. JLabel). If you do you will see strange things happening. And in specific... do you have a question about that code? It's hard to do much without a question to answer.
 
peter petros
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul Clapham wrote:In general I would recommend not mixing AWT components (e.g. Applet) with Swing components (e.g. JLabel). If you do you will see strange things happening. And in specific... do you have a question about that code? It's hard to do much without a question to answer.


I changed my code to




Questions
1. I want the new game button to start the game from the beginning.
I call init() but the image is not initialised.

2. I would like the order of panels to be vertical structured like :
New Game
Grid
moves

Could someone help me please?>
 
Paul Clapham
Sheriff
Posts: 21567
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
peter petros wrote:Questions
1. I want the new game button to start the game from the beginning.

In your original post you had some code which initialized the GUI. I don't see that in your second post. But anyway you would just have the action event of that button call some code which initializes the GUI. The contents of the GUI, that is, not code which adds labels to panels and so on.
I call init() but the image is not initialised.

What happens instead?
2. I would like the order of panels to be vertical structured like :
New Game
Grid
moves

Then choose and use a layout manager which does that. You might want to read a tutorial about layout managers. (Google keywords: java layout manager tutorial)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic