I have moved on to a second problem with my programme while I wait for advice on my original post about events. I though it best to keep to this
thread but please advise if it is preferable to start a new thread.
I need to set up FileChoosers to allow me to make use of my menu options in my GUI ie Open, Save and SaveAs.
I am a like confused as to the order and where code should be placed. I have tried to put some very basic code to initiate and use a fileChooser within my Translator class but I am begining to thing that it should be in a seperate class. However if I put it in a seperate class I get back to my origninal problem, ie I do not think that the classes are communicating and at present can not figure out any way of testing to determine what is wrong.
I have pasted the code I am tring to use below. It is in the actionPerformed method because I need to catch the event of selecting a menu option.
However I get a compilation error which is
---------- Capture Output ----------
> "C:\Program Files\Java\jdk1.5.0\bin\javac.exe" Translator.java
Translator.java:68: showOpenDialog(java.awt.Component) in javax.swing.JFileChooser cannot be applied to (Translator)
returnVal = fileChooser.showOpenDialog(this);
^
This seems to say that the JFileChooser can not be used within the Translator class.
Can someone please let me know if this is correct and if so suggest how I can capture the initial event of selecting the menu item outside of this class. I think it is again a case of using "parent." but since I can not get this to work properly I am not so sure.
Hope someone can help me understand what I am doing wrong.
Best wishes
Dianne Gerrelli
PS Anyone know why I am a Ranch Hand know instead of a Green Horn ?
It is quite flattering but I am afraid I am definitely still learning but would really like to learn and use
Java.