I've got this little program I wrote as a homework assignment, and I thought I'd take some functional liberties with it. The purpose is to take four test scores and four decimals and return the weighted average. I figured I'd add a little flair with an error message if the weights didn't add to 1, and just decided to do it by swapping out JLabels. What's odd is that each result (the average or the error) will work properly once, but it will never update again. Could somebody give me some insight into why each swap would only work once? Here's the entire code (it's all in one file on purpose; assignment requirements):
EDIT: Nevermind, I just realized what I did. I originally wrote the program with everything in the window JPanel, but then added the resultPanel to the gui frame afterwards, and didn't realize I was only repainting the window.