Added classes to draw lines in a window

This commit is contained in:
2019-02-12 16:21:57 -05:00
parent b6400bb145
commit c051ad6487
2 changed files with 63 additions and 0 deletions

25
DrawTest.java Normal file
View File

@@ -0,0 +1,25 @@
//Programs/Java/JavaTutorials/Draw.java
//Matthew Ellison
// Created: 02-12-19
//Modified: 02-12-19
//This is a program that simply draws a line from corner to corner in a window
import javax.swing.JFrame;
public class DrawTest{
public static void main(String[] argv){
Draw panel = new Draw();
//Create a new frame to hold the panel
JFrame application = new JFrame();
//Set the frame to exit when it is closed
application.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
application.add(panel); //Add the panel to the frame
application.setSize(500, 500); //Set the size of the frame
application.setVisible(true); //Make the frame visible
}
}