I dont know what you want really.
But yes you're right, you need to couple things that belong together(cohesion).
All the user interface should be separate from the actual funcioning code.
so yes, have outside classes that you call in the GUI to do the work for you.
ok, nevermind, I understand now.
all you need to do is have a listener on the menu, and when new is selected, just print the text "NEW" into that JTextArea.
I believe that is what you are asking.
and if you want to create a class that will create a file with the same text, look into BufferedWriter();
I think the initialization of a BufferedWriter to a file is like so:
so you could have a class called NewFile
and have it to where when you called an instance of it, it created a file
for for reading a writing.
then have different methods of that class that write to it and things of that sort. I dont know all the different IO classes by heart, but these are some
you should look at.
-PrintWriter
-FileOutputStream and FileInputStream
-BufferedReader
-BufferedWriter
-File
these are different class that can pertain to modifying and creating files,
I'm sure there are more.
Hope this helps you out,
Justin Fox
Justin Fox
[ November 17, 2007: Message edited by: Justin Fox ]