Well, let's take a look at the body of the while loop and look at exactly what it's doing:
reRollTotal = roll1+roll2;
new Text(reRollTotal, 10, 80, canvas);
So, if your firstRoll boolean is set to false, you add roll1 and roll2, assign them to reRollTotal and then create some new text with this total. The while loop then checks again whether firstRoll is false, it still is (because nothing in the loop changes the value of firstRoll) so it does exactly the same thing again. And again. And again. Giving you an infinite loop and therefore causing the thing to lock up.
At a quick glance it looks like your while loop should be an if statement - that way it'll only execute once each time you press the mouse, which is probably what you want.
A couple of other general pointers while I'm at it:
- When submitting code in code blocks, please try to indent it nicely - huge tabs everywhere make things a bit difficult to read! 4 spaces in place of a tab is a better alternative.
- It's very bad practice to have fields as anything other than private in Java (with the exception of constants, i.e. static final.) You've done it for your top field, but the rest should all be private also. If you want to know why it's a good habit to get into, just google around or ask and I'll elaborate.
- Are you sure you need your io import? I may be wrong because I haven't tried to compile your code, but I can't see anything from the io package used anywhere?
- Class names should ALWAYS (no exceptions here) start with a capital letter.
- The first line of your onMousePress class is:
This is almost certainly wrong - otherwise whenever you press the mouse firstRoll will be set to true. You probably want it in your begin method instead.
- Whilst not strictly wrong, statements like this:
if(firstRoll == true)
...are a bit long winded. The quicker and more preferred way of writing it is simply:
There's at least a couple of other bugs I think I've spotted, but I don't want to do the whole lot for you - try fixing those pointers and then feel free to ask again if you get stuck.