Steve Luke wrote: [...]
Paul Clapham wrote:The "return in 5 minutes" is the part of the design I don't understand either. What's the point of that? Why not just ask the next question immediately? Let the user decide if he wants to answer immediately or not.
And this idea of GUIs appearing and disappearing is completely non-standard too. You're designing your application as if you never saw any other applications, which surely isn't the case. As a beginner you should design your applications to work in a standard way, because it's a lot easier to do that. When you have more experience, then you can try writing applications which do weird things.
Ralph Cook wrote:The first thing I asked for was a one-paragraph summary of the program. I still have very little idea what the program is about, and none about how it goes about it. Appearing and disappearing panels? "Got to sleep for 5 minutes"?
I realize it's almost a lost art in software engineering, but what we need here is a functional description. How would you describe to a user what the program does?
rc
Ralph Cook wrote:
Try taking a step back and telling us, in one paragraph, what your program is supposed to do and what it does now. Specific things that puzzle me about the explanation you've written so far:
* Program starts, creates thread, starts run of the main class...
You normally create a thread other than the one you are running in when you want two things to proceed in parallel. You state that the main class loads array lists with data from text files, and I guess that's in the thread you create. What is the other thread doing?
The other does simply nothing. I just made a new one because I wasn't sure if laying the main thread to sleep would cause problems.
* for-loop starts
I gather you wanted something to loop -- what is it? Do you loop once per word the user enters? Once per panel? Once per month?
After all Actions have been done, the programm shall go to sleep for 5 minutes, when it wakes up again it finishes the method's and the loop starts from new.
* it continues with the whole thing, opening the same gui over and over
Now I'm lost -- what is 'the whole thing' you are referring to? Is opening a new gui at all something the program is supposed to do,you just want to control it?
It keeps reopening the same GUI because the loop finishes itself as there is no "Close gui when method is finished"
And the logical guess doesn't make any sense to me either; why would you get rid of a panel and open a neven under your control?
First I want a JTextField Panel which checks if the word is written right, if it's written wrong, the JTextField panel closes and a Panel with JRadioButton is where the other used to be before and more, but all depending on the same princip.
I'm sorry, but trying to read incomplete code in German is something I'm only liable to do if I think I can tell, from your description, the general sort of things I'm looking for.
No problem.
rc
Paul Clapham wrote:I think your line counting might be off by one. However the easiest thing to do is to put some debugging statements into your code to see what's happening. Like
for example.
Also, "String" is one of the worst possible variable names you could ever choose in Java. Whenever I see that I think of the type "String" and I have to force myself to realize that it's actually a variable name. Very confusing.
Rob Spoor wrote:Although it's not the cause of the NullPointerException, your call to linie.split("$") is wrong. The split method takes a regular expression, and $ has a special meaning in regular expressions. You must escape it: