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

Thread: what's the error with this?

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

    Default what's the error with this?

    can you please tell me what is the wrong with this java code??

     
    public class MainFrame
    {
    	   public  int OrgPnt1_X;
    	   public  int OrgPnt1_y;
    	   public  int OrgPnt2_x;
    	   public  int OrgPnt2_y;
    	   public  int H_Magnitude;
    	   public  int V_Magnitude;
     
    	MainFrame(int horz_dim, int vert_dim)
    	{
    		H_Magnitude=horz_dim;
    	    V_Magnitude=vert_dim;
     
    	    OrgPnt1_X=0;
    	    OrgPnt1_y=0;
    	    OrgPnt2_x=horz_dim;
    	    OrgPnt2_y=vert_dim;
    	}
    	public void setSize(int dim1, int dim2)
    	{
    		H_Magnitude=dim1;
    		V_Magnitude=dim2;
    	}
    	public void defineWorkGrid(int pnt1x, int pnt1y,int Pnt2x, int Pnt2y)
    	{
    		if ( (OrgPnt1_X > OrgPnt2_X) || (OrgPnt1_Y > OrgPnt2_Y ) )
    		{
    			OrgPnt1_X=Pnt2x;
    			    OrgPnt1_y=Pnt2y;
    			        OrgPnt2_X=pnt1x;
    			            OrgPnt2_y=pnt1y;
    		}
            if((OrgPnt1_X==OrgPnt2_x) && (OrgPnt1_Y > OrgPnt2_y) )
            {
            	OrgPnt1_X=0 ;
            	    OrgPnt1_Y=0 ;
            	        OrgPnt2_X=Pnt2x ;
            	            OrgPnt2_Y=Pnt2y ;       	
            }
            else
            {
            	OrgPnt1_X=pnt1x;
            		OrgPnt1_Y=pnt1y;
            			OrgPnt2_X=Pnt2x;
            				OrgPnt2_Y=Pnt2y;       					
            }
    	}//end of the method
    }// end of the class	
     
     
    class SubFrame extends MainFrame
    {
    	SubFrame(int horz_dim, int vert_dim)
    	{
    		super(horz_dim,vert_dim);
    	}
    }// end of the class

    the error message reads the following:
    --------------------Configuration: <Default>--------------------
    D:\javafiles\MainFrame.java:27: cannot find symbol
    symbol : variable OrgPnt2_X
    location: class MainFrame
    if ( (OrgPnt1_X > OrgPnt2_X) || (OrgPnt1_Y > OrgPnt2_Y ) )
    ^
    D:\javafiles\MainFrame.java:27: cannot find symbol
    symbol : variable OrgPnt1_Y
    location: class MainFrame
    if ( (OrgPnt1_X > OrgPnt2_X) || (OrgPnt1_Y > OrgPnt2_Y ) )
    ^
    D:\javafiles\MainFrame.java:27: cannot find symbol
    symbol : variable OrgPnt2_Y
    location: class MainFrame
    if ( (OrgPnt1_X > OrgPnt2_X) || (OrgPnt1_Y > OrgPnt2_Y ) )
    ^
    D:\javafiles\MainFrame.java:31: cannot find symbol
    symbol : variable OrgPnt2_X
    location: class MainFrame
    OrgPnt2_X=pnt1x;
    ^
    D:\javafiles\MainFrame.java:34: cannot find symbol
    symbol : variable OrgPnt1_Y
    location: class MainFrame
    if((OrgPnt1_X==OrgPnt2_x) && (OrgPnt1_Y > OrgPnt2_y) )
    ^
    D:\javafiles\MainFrame.java:37: cannot find symbol
    symbol : variable OrgPnt1_Y
    location: class MainFrame
    OrgPnt1_Y=0 ;
    ^
    D:\javafiles\MainFrame.java:38: cannot find symbol
    symbol : variable OrgPnt2_X
    location: class MainFrame
    OrgPnt2_X=Pnt2x ;
    ^
    D:\javafiles\MainFrame.java:39: cannot find symbol
    symbol : variable OrgPnt2_Y
    location: class MainFrame
    OrgPnt2_Y=Pnt2y ;
    ^
    D:\javafiles\MainFrame.java:44: cannot find symbol
    symbol : variable OrgPnt1_Y
    location: class MainFrame
    OrgPnt1_Y=pnt1y;
    ^
    D:\javafiles\MainFrame.java:45: cannot find symbol
    symbol : variable OrgPnt2_X
    location: class MainFrame
    OrgPnt2_X=Pnt2x;
    ^
    D:\javafiles\MainFrame.java:46: cannot find symbol
    symbol : variable OrgPnt2_Y
    location: class MainFrame
    OrgPnt2_Y=Pnt2y;
    ^
    11 errors

    Process completed.


  2. #2
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,424
    My Mood
    Hungover
    Thanks
    144
    Thanked 636 Times in 540 Posts

    Default Re: what's the error with this?

    OrgPnt2_x != OrgPnt2_X

    PS- Variable names should start with a lower-case letter.