0

I had finished the whole assignment but decided i wanted to move the testbox for the weather station a little. I tried to do so in the design tab of the temperature panel, then got an error

picture error

luckily i had saved everything. i closed eclipse and reopened the assignment. this did not help.

design tab assignment3gui enter image description here

I have no idea what to do, the code seems intact and doesn't show any errors. How can i get the TemperaturePanel back?

temperature panel code: picture one temperature panel picture two temperature panel

Share a link to this question (includes your user id)
| edit | | close | delete |
0

Show the code of your TemperaturePanel, it might have an error in one of the constructors.

You can also compare your constructor to the example given in the assignment, after the text "The new constructor now looks like ..." (halfway step 4)

Share a link to this answer (includes your user id)
| edit | delete |
  • Okay, I have added screenshots of the code to the question post. – Evi Jansen May 3 at 19:35    
  • @EviJansen Unfortunatly, the code in those screenshots is unreadable. Post the code itself (the text of both java files). Or maybe better: mail me the complete Eclipse project (create a zip file just like when handing in). – Fjodor van Slooten May 6 at 8:14    
0

That is a nasty problem. The red screens you get in the Window Builder editor, indicate there is a 'crash' (a fatal error) in the code of the TemperaturePanel's constructor. But then... how to find it. You will get the same error if you Run the application. But now, it will show all details of the error in the Console. And that's what we need to solve it.

Make the Console Window large. Then browse all the way to the top. Look at the image below. There is an invalid size (2) reported at the topmost line, related to line 35 of the code (1). If you click that link, it shows the code (3). And indeed: for a Gap, a negative number (-36) is not allowed. Gap's should always be positive. If you remove the minus sign (change the value to 36) it will be fine.

Now, the question remains... How did that minus sign appear there? I do not know. Could be an error in the Window Builder? Or maybe a typo you made?

Screenshot while running the app

Share a link to this answer (includes your user id)
| edit | delete |

Your Answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.