I recently started a project to create a 'battle calculator' for a PBeM I play and while it is progressing well I've run into several problems I'm hoping someone here can help me with.
I have searched through the forums and found answers to some questions but not these (or the answers I found I couldnt follow). I'm using JDK 1.3.1_02 & am currently downloading the Docs for it so feel free to tell me RTFM if its in there. Also I'm not sure if these are all beginner questions but I am definitely a beginner who has bitten off a little more than he can chew it seems...
Part of the reason for this project is to get my brain back up to speed for my second java
subject which I start in a week (Uni's back WooHoo)...
OK to start with I'm using BreezySwing & javax.swing to do the GUI.
Now onto the problems :
1. I'm running some menus across the top using the BreezySwing JMenuItem command
My problem here is I want to add submenus & cant figure out how to do it or even if its possible this way. If it isnt doable just let me know & I'll do it the long way by creating a MenuGroup etc...
2. Next up I've noticed weird stuff when doing some maths calculations.
ie (generic example)
Outputs the right numbers until i = 15 at which point it doesnt give 0.225 but 0.224999999 type answers. I've found posts here that indicate bigDecimal may be the way to get around this but thats something I have no idea about. Any pointers appreciated.
3. Rounding. Since I'm mimicing the PBeM engine code to do the calculations I need to round doubles to 2 or 3 decimal places at points. It seems (from posts here) that the only way around is to do something along the lines of multiplying it by 10 or 100, rounding that as an integer and then dividing by the original multiplyer. Is this correct? Is there any other way?
4. Running the code on other machines. I want to be able to distribute my program to others in my Game Clan to use. I have (again from a suggestion on this board) downloaded Excelsior JET to convert it to native code but this isnt working. What do I need to do to get the class to run on anyone elses machine? Assuming that dont have JDK etc installed of course
5. GUI. What is the best way to do a GUI? I'm just coding it into GBFrame and its OK but (due to my limited knowledge) its a bit rough. A pointer to a good tutorial would be most helpful here. I want to avoid a WYSIWYG program and do it by hand so I understand whats going on.
Well thats the major problems at the moment.
Thanks in advance for any help.