Grades reports hopefully tonight. 

Midterm exam on Thursday. 

Study guide for the exam posted. 

Chapter 9 was the reading assignment. 

Lab Assignment Eight -- what is it? 

http://silo.cs.indiana.edu:8346/c212/sum2015/0704a.phps

What's needed is to convert a file in the right context to a list of strings. 

In javax.swing there is a class JFrame that we can use ... 

https://docs.oracle.com/javase/8/docs/api/javax/swing/JFrame.html

In every JFrame there is a content pane (an instance of the class java.awt.Container). 

If you want to put something in the frame you need to negotiate with the content pane. 

A something that would be good to add to the JFrame would be a JComponent.

A JComponent will allow you to draw things like the big-bang ... 


import javax.swing.*;

public class LectureNine {
  public static void main(String[] args) {
    JFrame f = new JFrame("Exercise"); 
    f.setVisible(true);
    f.setSize(300, 300); 
  }
}


Now we take a slightly different approach:

import javax.swing.*; 

public class MyFrame extends JFrame {
  public MyFrame() {
    this.setVisible(true);
    this.setSize(400, 400); 
  }
}

I use this from main as follows: 

public class LectureNine {
  public static void main(String[] args) {
    MyFrame f = new MyFrame(); 
  }
}

https://docs.oracle.com/javase/8/docs/api/javax/swing/JComponent.html

https://docs.oracle.com/javase/8/docs/api/java/awt/Graphics.html

public class LectureNine {
  public static void main(String[] args) {
    MyFrame f = new MyFrame(); 
  }
}

import javax.swing.JComponent; 
import java.awt.Graphics; 
import java.awt.Color; 

public class MyJComponent extends JComponent {
  public void paintComponent(Graphics g) {
    g.setColor(Color.YELLOW); 
    g.fillOval(100, 100, 80, 80);  
    g.setColor(Color.BLUE); 
    g.drawOval(100, 100, 80, 80);  
  }
}
 
import javax.swing.JFrame; 
import java.awt.Container; 

public class MyFrame extends JFrame {
  public MyFrame() {
    this.setVisible(true);
    this.setSize(400, 400); 
    Container c = this.getContentPane();
    c.add( new MyJComponent() ); 
  }
}

At this point I have a very simple and static picture. 

https://docs.oracle.com/javase/8/docs/api/java/awt/event/MouseMotionListener.html


Attendance: write a short message to me indicating what you think about
the proposed structure of the midterm. I said 5 random problems from the
list posted? What do you think? 

Mark, Logan, Daniel, Jared, Nathan, Trevor, Qin, Walter, Hallie, Judy, Adam, 
Gabriela, James, Brennan, Jacquelyn, William, Alex Ong, Morgan, Paul, Zac, 
Jingzhe, Yiming, Nick, Grant, Jon, MAR, Mohan, Jack, Phoebe, Lauren