Java Swing JFileChooser problem..

I’m having problems trying to get the JFileChooser class to work with my program…

I want to make the event of clicking the ‘load’ option from the menu, make the open file dialog to be shown…

Here’s my code for the actionevent:

      public void actionPerformed(ActionEvent event) 
      {
            // deals with the GUI action events.
            ...
            // filechooser load and save button clicks from menu
            ...
            // Handle open button action.
            if (event.getSource() == loadMenuItem)
            {
                  int returnVal = gaitFc.showOpenDialog(GUI3D.this);

                        if (returnVal == JFileChooser.APPROVE_OPTION)
                        {
                                File file = gaitFc.getSelectedFile();
                               //This is where the application would open the file.
                              // blah blah blah blah..
                        } else 
                        {
                               // blah blah blah blah..      
                         }
            }

It doesn’t seem to like the “loadMenuItem” even tho thats the name of the menuItem I want it respond to…

Also concerning the “showOpenDialog”, it says “GUI3D.this” in the type field is not an applicable arguement…

I don’t kno how to fix these Issues and i’m running out of valuable project time, racking my brain over it…

Please help if possible?

is loadMenuItem an Object ? is it in context ?
I don’t understand why you are using GUI3D.this ?
is the containing class GUI3D ? is it a component ? if so
then just use ‘this’ .

its a bit hard to work out whats wrong from the brief code snippet above, can’t tell whether you’ve implemented the interface in your main component object, or its an inner class amongst other things.

D.

oops sorry I’ve already solved the problem, sorry!

I frgot to post and let people kno… thanx anyways…