Hi I'm new to the forum, new to
Java and in fact all programming. I started practicing with some beginner material recently just for fun, so I apologize in advance if my terminology is off and for the long and possibly ugly code I'm posting here. I would appreciate any critique/advice I can get.
So, for the first time I tried writing a program using only windows (nothing prints to the console). Here is my code, it consists of three classes, first the class with the main method (I'm using Eclipse btw):
^ This is just a simple dice rolling game that takes place in dialog boxes with JOptionPane. At one point it calls a method from the "Wait" class that pauses the program for one second:
I sincerely don't understand the point of handling exceptions, but I'm told I have to do this to make this part work.
At the end of the first class I call a method from the "RollAgain" class, which has the code for a JFrame I tried to make with WindowBuilder that gives the user the option of playing again . I did this by calling the main method again from the first class (so basically both classes end by executing the other class, creating a loop), I saw several advanced looking (for me) examples that I just didn't understand, so I tried doing it this way first...
...and it worked! Eclipse just forced me to put null in the parameter, I don't know why but as long as it's working I'm not going to complain.
The RollAgain Class (this was the most difficult part to get working and I still don't understand the structure as well as I would like, most of it was autogenerated from WindowBuilder and the design view):
The only problem I still have is the "Roll Again?" window refuses to close when I click the yes or no buttons, and a new window is created on each loop, what am I doing wrong? Also I can't seem to center anything in my window from design view.
Thanks to anyone who took the time to read all this