// Examples of Class types: String, JFrame JFrame mywindow; // error: doesn't understand what JFrame is import javax.swing.JFrame; JFrame myWindow; myWindow myWindow = new JFrame(); myWindow myWindow.setVisible(true); // method call myWindow.setVisible(false); myWindow.setVisible(true); myWindow.setTitle("This is my window."); myWindow.setSize(400, 400); // instruction: action to be performed // Java statement: an instruction written in the Java language // Java program: an organized collection of Java statements // execute: follow the instructions myWindow.getWidth() myWindow.getHeight() myWindow.getTitle() // Three types of methods: functions, procedures, constructors // function: returns data of a particular type // procedure: perform a set of actions, but don't return any data // constructor: functions that create the object and return it JFrame w2 = new JFrame(); w2.setVisible(true); w2.setTitle("Second window"); w2.setLocation(0, 500); w2.setLocation(0, 5000); w2.setLocation(0, 500); //what if we want to customize JFrame? // for example double the width&height of the window // or make the window a perfect square OurJFrame ow = new OurJFrame(); ow.setVisible(true); ow.setSize(100,300); ow.doubleSize(); // method exists, //but it doesn't do anything yet //let's implement it! OurJFrame ow = new OurJFrame(); ow.setVisible(true); ow.setSize(100,300); ow.doubleSize();