Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 5 of 5

Thread: i'm getting this error, dont know why? please help

  1. #1
    Member
    Join Date
    Nov 2010
    Posts
    40
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default i'm getting this error, dont know why? please help

    hi, i'm getting this error, dont know why? please help
    D:\javafiles\Image Matching Algorithm\ImageMatchingAlgorithm.java:107: cannot find symbol
    symbol : variable getDimX
    location: class SubWindow
    System.out.println("sw.getDimX ="+sw.getDimX+" "+"sw.getDimY ="+sw.getDimY);
    ^
    D:\javafiles\Image Matching Algorithm\ImageMatchingAlgorithm.java:107: cannot find symbol
    symbol : variable getDimY
    location: class SubWindow
    System.out.println("sw.getDimX ="+sw.getDimX+" "+"sw.getDimY ="+sw.getDimY);
    ^
    D:\javafiles\Image Matching Algorithm\ImageMatchingAlgorithm.java:108: cannot find symbol
    symbol : variable setDimX
    location: class SubWindow
    System.out.println("sw.setDimX ="+sw.setDimX+" "+"sw.setDimY ="+sw.setDimY);
    ^
    D:\javafiles\Image Matching Algorithm\ImageMatchingAlgorithm.java:108: cannot find symbol
    symbol : variable setDimY
    location: class SubWindow
    System.out.println("sw.setDimX ="+sw.setDimX+" "+"sw.setDimY ="+sw.setDimY);
    ^
    4 errors

    import java.util.*;
    import  java.lang.*;
     
     
    public class ImageMatchingAlgorithm
    {
    	int swaped1;
    	int swaped2;
    	int isolated;
     
    	public boolean hasReversed(int mw_axis, int sw_axis)
    	{
    		if(sw_axis > mw_axis)
    			return true;
    			       return false;	
    	}
     
    	public boolean isTangible (int mw_axis, int sw_axis)
    	{
    		if (mw_axis == sw_axis)
    			return true;
    			       return false;
    	}
     
    	public void doIsolate(int mw_axis)
    	{
    		isolated=mw_axis-1;
    	}
    	public int getIsolated()
    	{
    		return isolated;
    	}
    	public void doSwap(int coor1, int coor2)
    	{
    		swaped1=coor2;
    		swaped2=coor1;
    	}
    	public int getMWSwapedDim()
    	{
    		return swaped1;
    	}
    	public int getSWSwapedDim()
    	{
    		return swaped2;
    	}
     
    	public static void main (String[] args) 
    	{
    		int scanx;
    		int scany;
    		Scanner readDim = new Scanner(System.in);
     
    		MainWindow mw = new MainWindow();
    		SubWindow  sw = new SubWindow();
    		ImageMatchingAlgorithm Obj = new ImageMatchingAlgorithm();
     
     
    		int [] CorrlationMatrix=new int [sw.correlationSize()];
     
    		    System.out.print("Dimension of MW X axis:");
    		    scanx=readDim.nextInt();
    	        mw.setDimX(scanx);
    		              System.out.print("Dimension of MW Y axis:");
    		              scany=readDim.nextInt();
    		              mw.setDimY(scany);
    		                        System.out.print("Dimension of SW X axis:");
    	                         	scanx=readDim.nextInt();
    		                        sw.setDimX(scanx);
    		                                  System.out.print("Dimension of SW Y axis:");
    		                                  scany=readDim.nextInt();
    		                                  sw.setDimY(scany);
     
    	 	    if (Obj.hasReversed(mw.getDimX(), sw.getDimX()) )
    	 	    {
    			     Obj.doSwap(mw.getDimX(), sw.getDimX());
    			     mw.setDimX(Obj.getMWSwapedDim());
    			     sw.setDimX(Obj.getSWSwapedDim());
    	 	    }    
    		                if (Obj.isTangible(mw.getDimX(), sw.getDimX()))
    		                {
    		                     Obj.doIsolate(mw.getDimX());
    			                 sw.setDimX(Obj.getIsolated());
    		                }
    		                            if (Obj.hasReversed(mw.getDimY(), sw.getDimY()) )
    	 	                            {
    			                             Obj.doSwap(mw.getDimY(), sw.getDimY());
    			                             mw.setDimY(Obj.getMWSwapedDim());
    			                             sw.setDimY(Obj.getSWSwapedDim());
    	 	                            }    
    		                                       if (Obj.isTangible(mw.getDimY(), sw.getDimY()))
    		                                       {
    		                                           Obj.doIsolate(mw.getDimY());
    			                                       sw.setDimY(Obj.getIsolated());
    		                                       }		                                   	
     
                int [][]MainGrid = mw.setPixelValues( mw.defGrid(mw.getDimX(),mw.getDimY()) );
                int [][]SubGrid = sw.setPixelValues( sw.defGrid(sw.getDimX(),sw.getDimY()) );
     
                mw.display();
                sw.display();
     
     
                //for(int i=0;i<t.length;i++)
                //	 for (int j=0;j<t[0].length;j++)
     
                sw.initCoor(sw.getDimX(),sw.getDimY());
                System.out.println("sw.getDimX ="+sw.getDimX+" "+"sw.getDimY ="+sw.getDimY);
                System.out.println("sw.setDimX ="+sw.setDimX+" "+"sw.setDimY ="+sw.setDimY);
                //System.out.println(r);
                System.out.println();
                System.out.println();
     
                /*do{           
     
                        int sum=0;    
                        int rounds=0;    
     
                      for(int i=sw.getCoorX0();i<((sw.swDimx-1)+sw.getCoorX0());i++)
                      {
                           for (int j=sw.getCoorY0();j<((sw.swDimy-1)+sw.getCoorY0());j++)
                           {
                                    sum+=MainGrid[i][j];
                           }
                      }               
            	                    CorrlationMatrix[rounds]=sum;
            	                    rounds++;
            	                    if (sw.HasVerticalOverLap())
                   	                {
                		                sw.Vertical_Shift();
                		                sw.CarryBack();
                	                }
                	                sw.Horizontal_Shift();
            	                    System.out.print(sum+" ");
     
                  }while(!sw.notDone());           */
                 //System.out.print("\n"+sw.initCoor()+"\n");
     
    		    //System.out.println(mw.getDimX()+" "+mw.getDimY());
    		    //System.out.println(sw.getDimX()+" "+sw.getDimY());                   		
     
     
    	}
    }


  2. #2
    Super Moderator helloworld922's Avatar
    Join Date
    Jun 2009
    Posts
    2,896
    Thanks
    23
    Thanked 619 Times in 561 Posts
    Blog Entries
    18

    Default Re: i'm getting this error, dont know why? please help

    examine your code:
                System.out.println("sw.getDimX ="+sw.getDimX+" "+"sw.getDimY ="+sw.getDimY);
                System.out.println("sw.setDimX ="+sw.setDimX+" "+"sw.setDimY ="+sw.setDimY);

    I'm assuming you meant to call the methods getDimX() rather than try to get a field named getDimX (same thing for getDimY). I don't know why you're trying to print out setDimY, usually set denotes void method which allows you to set a variable's value.

  3. #3
    Member goldest's Avatar
    Join Date
    Oct 2009
    Location
    Pune, India
    Posts
    63
    Thanks
    1
    Thanked 12 Times in 10 Posts

    Thumbs up Re: i'm getting this error, dont know why? please help

    Yeah, exactly as said above. You shouldn't print anything inside a setter method as it is usually a VOID, which means returns nothing.

    The only thing you need is following line of code instead of the two lines you have mentioned above,

    System.out.println("sw.getDimX ="+sw.getDimX()+" "+"sw.getDimY ="+sw.getDimY());
    Hope that helps!
    Goldest
    Java Is A Funny Language... Really!

    Sun: Java Coding Conventions

    Click on THANKS if you like the solution provided.
    Click on Star if you are really impressed with the solution.

  4. #4
    Member
    Join Date
    Nov 2010
    Posts
    40
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default Re: i'm getting this error, dont know why? please help

    Quote Originally Posted by helloworld922 View Post
    examine your code:
                System.out.println("sw.getDimX ="+sw.getDimX+" "+"sw.getDimY ="+sw.getDimY);
                System.out.println("sw.setDimX ="+sw.setDimX+" "+"sw.setDimY ="+sw.setDimY);

    I'm assuming you meant to call the methods getDimX() rather than try to get a field named getDimX (same thing for getDimY). I don't know why you're trying to print out setDimY, usually set denotes void method which allows you to set a variable's value.

    thank u very much for ur help,however, i still have some errors and i'll post them

  5. #5
    Member goldest's Avatar
    Join Date
    Oct 2009
    Location
    Pune, India
    Posts
    63
    Thanks
    1
    Thanked 12 Times in 10 Posts

    Default Re: i'm getting this error, dont know why? please help

    Sure!

    Goldest
    Java Is A Funny Language... Really!

    Sun: Java Coding Conventions

    Click on THANKS if you like the solution provided.
    Click on Star if you are really impressed with the solution.

Similar Threads

  1. [SOLVED] I dont know how to complete this code?
    By jwb4291 in forum What's Wrong With My Code?
    Replies: 2
    Last Post: November 8th, 2017, 11:11 PM
  2. WHY this code dont work?
    By sibbe in forum Java Theory & Questions
    Replies: 7
    Last Post: December 9th, 2010, 10:47 AM
  3. Dont understand what to write.. :/
    By johnwalker in forum What's Wrong With My Code?
    Replies: 1
    Last Post: December 4th, 2010, 09:31 PM
  4. I dont get it....please help
    By DestinyChick1225 in forum What's Wrong With My Code?
    Replies: 12
    Last Post: June 30th, 2010, 03:16 AM
  5. Dont laugh at me
    By Neblin in forum What's Wrong With My Code?
    Replies: 5
    Last Post: October 3rd, 2009, 08:18 AM