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...
I forgot the transparent parts of the images. My bad. :/
Hello!
Iīve a little issue I would like to get solved.
On my JFrame there seems to be like an invisible border around the frame. So when something should be invisible or stop at ykoord = 0...
As it is now, the hour-pointer is updated 1 degree every 120 s, the minute-pointer is updated 6 degrees every 60 s, and the second-pointer is updated 6 degrees every second.
It should be able to...
Ok so hereīs a modified repost to clearify!
Actually, (I noticed this now when running) the clock is not alright when the order of the calls is "correct", the minute-pointer's angle is not right...
You mean that I change the pRose to pHour for example? And why do you call them hands in the first place?
Yes, that sounds true.
Actually, (I noticed this now when running) the clock is not alright when the order of the calls is "correct", the minute-pointer's angle is not right (the other pointer's...
Ok, thanks!
What I see is that all the pointers get their initial angle. After 1 second when the second-pointer's position updates, all of the three pointers are updated just as the...
Could you please help me with how to code this, Iīm not sure how.
Thanks for all the help and tips you have given me. Iīve managed to fix it now, but thereīs one thing I really donīt understand.
Everything works fine as it is coded now, but if I change the order...
The code I have is also rotating an image just the way I want, the problem is when painting multiple images with different getAngle()...
I donīt know how to do what you wanted me to try Kevin, but here is a try: (I know it wont compile, and I know itīs all wrong probably, but please tell me how to do it correctly).
public void...
Thanks, but thatīs with just one image. Iīve managed to modify one picture myself but Iīm struggling modifying more than one pic in the same paint() method.
What tutorial? I donīt find it...
Hello!
Iīve got a problem when I try to paint my clock which consists of a wheel and three pointers in the shapes of different flowers (pink, weird, rose). The wheel is drawn as I want. And the...
The getResource() method returns the fileName
And yes, the file exists.
I thinks itīs quite weird since all I did was to modify the pics from jpg to gif, (deleted the jpgs and inserted the gifs...