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 8 of 8

Thread: why i still receive these errors

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

    Default why i still receive these errors

    this code gives me the following errors,
    why?
    --------------------Configuration: <Default>--------------------
    D:\javafiles\Image Matching Algorithm\ImageMatchingAlgorithm2.java:107: cannot find symbol
    symbol : variable getDimX
    location: class SubWindow2
    System.out.println("sw.getDimX ="+sw.getDimX+" "+"sw.getDimY ="+sw.getDimY);
    ^
    D:\javafiles\Image Matching Algorithm\ImageMatchingAlgorithm2.java:107: cannot find symbol
    symbol : variable getDimY
    location: class SubWindow2
    System.out.println("sw.getDimX ="+sw.getDimX+" "+"sw.getDimY ="+sw.getDimY);
    ^
    D:\javafiles\Image Matching Algorithm\ImageMatchingAlgorithm2.java:108: cannot find symbol
    symbol : variable getDimX
    location: class SubWindow2
    System.out.println("sw.getDimX ="+sw.getDimX+" "+"sw.getDimY ="+sw.getDimY);
    ^
    D:\javafiles\Image Matching Algorithm\ImageMatchingAlgorithm2.java:108: cannot find symbol
    symbol : variable getDimY
    location: class SubWindow2
    System.out.println("sw.getDimX ="+sw.getDimX+" "+"sw.getDimY ="+sw.getDimY);
    ^
    4 errors

    Process completed.


     
    import  java.util.*;
    import  java.lang.*;
     
     
    public class ImageMatchingAlgorithm2
    {
    	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);
     
    		MainWindow2 mw = new MainWindow2();
    		SubWindow2  sw = new SubWindow2();
    		ImageMatchingAlgorithm2 Obj = new ImageMatchingAlgorithm2();
     
     
    		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(MainGrid);
                System.out.println("sw.getDimX ="+sw.getDimX+" "+"sw.getDimY ="+sw.getDimY);
                System.out.println("sw.getDimX ="+sw.getDimX+" "+"sw.getDimY ="+sw.getDimY);
                //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
    Member goldest's Avatar
    Join Date
    Oct 2009
    Location
    Pune, India
    Posts
    63
    Thanks
    1
    Thanked 12 Times in 10 Posts

    Cool Re: why i still receive these errors

    First of all, have a look at the below points:

    1) Use
    code goes here
    when you post your code.

    2) Don't create new threads for same problems. You were supposed to post these errors on your previous thread only.

    Now, coming back to your errors, they are the same. Even after clearly mentioning your errors, you are not accessing the methods in the right way.

    sw.getDimX is accessing variable named getDimX [which doesn't exist in your code].

    sw.getDimX() is accessing method named getDimX(). [Notice the bracket ().]

    So either declare the variables getDimX and getDimY or access the methods in right way.

    Please check the solution provided here

    Hope thats clear!
    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.

  3. The Following User Says Thank You to goldest For This Useful Post:

    JavaPF (December 17th, 2010)

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

    Default Re: why i still receive these errors

    thank you for your help
    it works now.

    and sorry for being unfamiliar with the forum rules

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

    Default Re: why i still receive these errors

    1-would you please give me a simplified example of Encapsulation and Ploymorphism?
    2-either both of the fore-mentioned techniques were applied in my java code" the one you corrected to me"??

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

    Talking Re: why i still receive these errors

    There are so many reference sites providing the information about java's OOPS concepts. You can refer to any of them.

    For now, these are the two links which I find useful for starters.

    For Polymorphism : Click here
    For Encapsulation : Click here

    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.

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

    Default Re: why i still receive these errors

    And I have deliberately not commented on your second point above,
    2-either both of the fore-mentioned techniques were applied in my java code" the one you corrected to me"??

    Because I want you to find it out on your own. After reading good documentation about OOPS, you will be surely able to find that out.

    Best of luck!
    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.

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

    Default Re: why i still receive these errors

    thank you
    i'm trying to find out

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

    Default Re: why i still receive these errors

    You are Welcome and let us know when you find it out.
    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. Many Errors
    By Woody619 in forum What's Wrong With My Code?
    Replies: 10
    Last Post: July 16th, 2010, 09:36 PM
  2. Getting errors
    By Nonire in forum What's Wrong With My Code?
    Replies: 7
    Last Post: July 4th, 2010, 12:21 PM
  3. [SOLVED] Send and Receive Parameter
    By java_mein in forum JavaServer Pages: JSP & JSTL
    Replies: 2
    Last Post: May 14th, 2010, 02:22 PM
  4. Not able to receive SOAP response
    By abhisekh in forum What's Wrong With My Code?
    Replies: 2
    Last Post: May 12th, 2010, 07:20 AM
  5. [help] cant receive sms
    By ordinarypeople in forum Java ME (Mobile Edition)
    Replies: 0
    Last Post: April 4th, 2010, 02:41 PM