Re: Beginner GUI - JTextEdit
You could create a collection of JTextComponent (which includes JTextFields, JTextAreas, JEditorPane, JTextPane,...), give your gui a public void reset() method, and in this method, loop through the collection clearing each text component.
Re: Beginner GUI - JTextEdit
Thanks Fubarable. If I have you correctly, I should write a function reset() and then call it if the action event equals the reset button? This aught to work :)
Still a very beginner here, The program has a paint(Graphics g) method, which is apparently called whenever the frame needs to be repainted (resizing for example). But I never explicitly call paint(). My teacher has hinted that there is a similar "update" method being called behind the scenes, and we should use this as well. If a "Play" button is pressed, the program should do things, but at the same time the "Stop" button needs to be available (I guess I assume an infinite loop inside of actionPerformed is a bad idea).
Edit: And I have been searching for this answer, problem is I hardly know what to search for, basic Java Application "something" I guess.
"Paint, Repaint, Update", the fact that they exist is all I know from my class notes..
Edit: Pressing the "play" button disables it, so what I really need is something that will run update (called by repaint I guess), if the play button is disabled.
Sorry about the edits, but I'm not just waiting for the answer :)
Final Edit: Looks like I got it, I needed a SwingWorker. Man, teacher is putting us through some ropes