Hereīs an SSCCE:
http://www.filedropper.com/spacesscce
Thanks for helping!
Type: Posts; User: gargamel7
Hereīs an SSCCE:
http://www.filedropper.com/spacesscce
Thanks for helping!
Thanks for the tips Spidey! Actually, I have fixed the screen-switching issue. The thing left is that the game-room donīt listen to user inputs. Anyone who may know what the problem is?
Nothing happened when adding requestFocusInWindow() in the game-class-constructor. Yes it works without the CardLayout and yes, it works as the default visible card.
Hereīs the game-class. Itīs...
Thanks! I followed the tutorial and made the switching work. But. When the screen is switched from menu-room to game-room, user inputs donīt work in game-room. Everything is painted correctly,...
What tutorial did you give me?
The cl.show(cardPanel, "" + game); came from cl.show(cardPanel, "" + (currentCard)); in this tutorial:
Java Tips - How to use AWT CardLayout
Since we are very...
The code combiles without errors so itīs working, but it isnīt done. I wanted to know if everything was correctly done, and not full of code-bits that was unnecessary.
Now my next question is how...
Thanks for the tip, but this is just about common screenswitching thatīs seen in most games. :)
The room-objects are a menu class and a game class, both are extending JPanel.
In the Menu-room there are a go-button (think of the go-button as a JPanel). I need to add this JPanel called p to...
Every tutorial Iīve found about CardLayout just demonstrates its use within one class that has some JPanels set up there. I donīt get how I do to integrate my room-objects with CardLayout. Please...
Hello!
Iīm making a simple game which consists of a Menu-screen with some images and a go-button. If you click on the go-button with the mouse you will be taken to the Game-room where there are...