Nate Benton

Greenhorn
+ Follow
since May 19, 2014
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
5
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Nate Benton

thank you very much, I did not know that it did that.
5 years ago
My program creates a file but cannot write to it and i cannot figure out why.
How can i fix this code so that the FileOutputStream writes the String "Output" to the file HighScore.


5 years ago
I tried using card layout, but the problem persisted. Eventually the Screen did change it just waited until DataProc() was done running. So i then tried multithreading, it fixed the problem of it not Changing screens, but now my keyListeners will not work. I think this is because i am using "this" in my addKeyListener() method.




this is where i start the new thread. this code resides in DataProc class.


I start doInBackground in my actionPerformed() method.


the KeyListener() methods are located in DataProc class
5 years ago
From The actionPerformed() method i have code to remove the GameOver Jpanel and then to load the ActionPanel back onto the Main Frame.

I found that calling the DataProc() method stops the GUI from updating and i am not sure why. if i do not call DataProc() the GUI updates but the rest of the program does not run.

I do enable the PlayAgain Button I just never disable it.

This is from DataProc, it is the actionPerformed():
5 years ago
I am Working on a game where the user is a character who must avoid falling rocks. The game works fine until i try to play it again without restarting it. The problem occurs when the game over screen is displayed and i click on a PlayAgain button which has an action listener. In the actionPerformed() method i attempt to reset the game to play as if i had just started it. Instead the DataProc method runs and does not display anything to the GUI, as this is happening the GUI seems to be frozen on the GameOver screen.

I am a beginner at java, especially java swing, so any tips rather than just a solution to my problem would be appreciated.
Sorry for the large amount of code posted I'm not sure what is needed to answer my question.

heres the code:
DataProc:


GUI:


thanks,
5 years ago