Sign in to follow this  
Spencer Burd

Need help displaying name of window

Recommended Posts

package falling;
public class window {
this.setTitle("Falling");
}
if(false)
{
    this.setExtendedState(this.MAXIMIZED_BOTH)

}
else
{
    this.setSize (1024, 768)
this.setLocationRelativeTo(null)
this.setResizable(false)
}

 

Netbeans is saying that this.setTitle("Falling") expects a class,method or enum. However i thought i already specified that is was public class window in package falling. Am i forgetting something?

Edited by 018thedude

Share this post


Link to post
Share on other sites

package falling; <- this is fine

// Note, convention is to use a Capital letter for class names
// Window, not window.  Not an error, just what everyone does 
public class window { <- start window class definition


   this.setTitle("Falling"); <- this code isn't in the right place.  Try a constructor or a method.

} <- end window class definition

// This code below the comment doesn't belong to the window class.  It doesn't belong to any class.
// Fix this :)
if(false)
{
   this.setExtendedState(this.MAXIMIZED_BOTH)  <- somthing missing here
 
}
else
{
   this.setSize (1024, 768) <- somthing missing here
   this.setLocationRelativeTo(null) <- somthing missing here
   this.setResizable(false) <- somthing missing here
}
Edited by Glass_Knife

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this