Results 1 to 6 of 6
  1. #1
    noviceJava is offline Member
    Join Date
    Apr 2012
    Posts
    16
    Rep Power
    0

    Default cannot find symbol errors

    I have the following code snipet and I get the following errors

    help


    interface expected here
    [javac] private class fileFilter implements FileNameExtensionFilter{
    [javac] ^
    cannot find symbol
    [javac] symbol : method fileFilter(java.lang.Object)
    [javac] location: class gui.components.StartupDialog
    [javac] fileFilter (source);

    private void browseFiles(Object source) {
    File currentDir = new File(propertiesFilePath);
    fileChooser.setCurrentDirectory(currentDir);

    if (source.equals(propertiesBrowse)) {
    fileChooser.setApproveButtonText("Select MDN Properties File");
    fileChooser.setDialogTitle("MDN Properties File");
    }
    else if (source.equals(siteBrowse)) {
    fileChooser.setApproveButtonText("Select Site File");
    fileChooser.setDialogTitle("Site File");
    }
    else if (source.equals(geoBrowse)) {
    fileChooser.setApproveButtonText("Select Geomap File");
    fileChooser.setDialogTitle("Geomap File");
    }
    else {
    fileChooser.setApproveButtonText("Select Plot File");
    fileChooser.setDialogTitle("Plot File");
    }

    int returnVal = fileChooser.showOpenDialog(this);
    if (returnVal == JFileChooser.APPROVE_OPTION) {
    File file = fileChooser.getSelectedFile();
    updateFile(source, file);
    fileFilter (source);
    }
    }

    /**
    * create the file extension in the Opendialog box
    */

    private class fileFilter implements FileNameExtensionFilter{
    private Object source;

    public fileFilter(){
    if ((source == propertiesBrowse) || (source == propertiesText)) {
    FileNameExtensionFilter extension = new FileNameExtensionFilter(
    "MDN Properties File","properties");
    }
    else if ((source == siteBrowse) || (source == siteText)) {
    FileNameExtensionFilter extension = new FileNameExtensionFilter(
    "Site File","sd");
    }
    else if ((source == geoBrowse) || (source == geoText)) {
    FileNameExtensionFilter extension = new FileNameExtensionFilter(
    "Geomap File","gm");
    }
    else if ((source == plotBrowse) || (source == plotText)) {
    FileNameExtensionFilter extension = new FileNameExtensionFilter(
    "Plot File","csv");
    }
    }
    }

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    20,003
    Rep Power
    33

    Default Re: cannot find symbol errors

    Please edit your post and wrap your code with code tags:
    [code=java]
    YOUR CODE GOES HERE
    [/code]
    to get highlighting and preserve formatting.
    If you don't understand my response, don't ignore it, ask a question.

  3. #3
    noviceJava is offline Member
    Join Date
    Apr 2012
    Posts
    16
    Rep Power
    0

    Default Re: cannot find symbol errors

    not sure how to do that

  4. #4
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    20,003
    Rep Power
    33

    Default Re: cannot find symbol errors

    Press the Edit Post button at the bottom of the post.
    If you don't understand my response, don't ignore it, ask a question.

  5. #5
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    6,226
    Rep Power
    14

    Default Re: cannot find symbol errors

    Quote Originally Posted by noviceJava View Post
    not sure how to do that
    The easiest way is to go into the advanced editor (right side, at the end of the posts). Then highlight your code and click the # sign.

    Regards,
    Jim
    The JavaTM Tutorials | SSCCE | Java Naming Conventions
    Poor planning on your part does not constitute an emergency on my part

  6. #6
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    12,059
    Rep Power
    26

    Default Re: cannot find symbol errors

    Quote Originally Posted by noviceJava View Post
    not sure how to do that
    How many times do you need to be told?
    http://www.java-forums.org/new-java/...tml#post370114

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. Cannot find symbol errors question
    By zlloyd1 in forum New To Java
    Replies: 1
    Last Post: 12-17-2012, 03:24 PM
  2. Keep on getting cannot find symbol errors...
    By wizar in forum New To Java
    Replies: 6
    Last Post: 11-25-2010, 04:31 AM
  3. "Cannot find symbol" errors in Java
    By 23Zone in forum New To Java
    Replies: 1
    Last Post: 02-17-2010, 07:13 AM
  4. Replies: 9
    Last Post: 10-18-2008, 08:26 PM
  5. Replies: 3
    Last Post: 05-01-2008, 08:30 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •