import javax.swing.*;

/* This is the class we used to demonstrate the use of a field
   (or instance variable), which is a field declared in a class. */
public class Demo4 extends JFrame {
    
    // Set the height of this window to its width
    public void setHeight() {
        setSize(getWidth(), getWidth());
    }
    
    // previous title (initially "")
    private String pTitle= "";
    
    // Set the title to s
    public void setTitle(String s) {
        int temp;
        pTitle= getTitle();
        super.setTitle(s);
    }
    
    // Set the title to the previous title
    public void setToPrevious() {
        String temp;
        temp= getTitle();
        super.setTitle(pTitle);
        pTitle= temp;
    }
    
}