import javax.swing.JFrame;

/**
 * OurJFrame is a customized JFrame.
 * 
 * public is an access modifier.
 * "extends JFrame": inherit data and methods from JFrame
 */
public class OurJFrame extends JFrame {
  
  // widthFactor is an instance variable
  private int widthFactor;

  /**
   * Doubles the width of the window.
   * 
   * void indicates that this method is a procedure.
   * () is empty: (no parameters)
   */ 
  public void doubleWidth() { 
    this.setSize(this.getWidth() * 2 , this.getHeight());
  }    
  
  /**
   * Set the value if the widthFactor variable.
   */
  public void setWidthFactor(int factor) {
    this.widthFactor = factor;
  }  
  
  /**
   * Get the value of widthFactor.
   * 
   * (the part between {} is the body of the method)
   */
  public int getWidthFactor() {
    return this.widthFactor;
  }  
  
  /**
   * Increase the width by a certain factor.
   */
  public void changeWidth() {
    this.setSize(this.getWidth() * this.widthFactor
                   , this.getHeight());
  }  
  
}  
