Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

sliding puzzle help

 
Greenhorn
Posts: 4
  • 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
 
Marshal
Posts: 25594
69
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: 4
  • 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
Marshal
Posts: 25594
69
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)
 
I am Arthur, King of the Britons. And this is a tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic