Sign in to follow this  
chosenkill6

Java GUI Elements now drawing

Recommended Posts

chosenkill6    163

First of all, I apologize for posting so much code, I really have been at this for hours now and I am beyond frustrated, I cannot seem to find the error in my code. I never post all my code on here for help but really I am at a loss as to what else I can do. This is pretty much my last ditch effort to find it, I really don't know what to do after this. There is not much to the code, it is just very repetitive. Any help would really be greatly appreciated. If anyone could even just point me in the right direction I would really be grateful.

 

Here is my project file for eclipse:

https://www.dropbox.com/s/8j21k4f6kojt9t0/Yahtzee%202.0.zip

 

If you would like to just look at the code online:

YahtzeeMain.java : http://pastebin.com/U29ggrxd

GUIThread.java: http://pastebin.com/Hbg5AShJ

GUIFrame.java: http://pastebin.com/dxHsY8nB

Player.java: http://pastebin.com/ByK8043V

Share this post


Link to post
Share on other sites
LorenzoGatti    4442
If you know enough about Swing to understand the basic mechanism, i.e. enough to design a GUI application without major guesswork, debugging should be unusually straightforward and effective for this kind of issue.

You have a known target, the paint() or paintComponent() methods of your classes, and a simple breakpoint at their beginning is going to cover all likely bug categories: find out if and when your drawing code is actually called, inspect variables which could be different from your expectations (for example the position of other GUI elements that might hide the problem ones), and follow the actual drawing that takes place (in case it's wrong).

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this