Java programming part 90 Graphics : Java drawLine

Published: 28 June 2012
on channel: Redemptie
8,423
17

Java Programming tutorial, GUI, Graphical User Interface. this tutorial is teaching. How to use Java graphics for drawing, lines for graphics interfaces and games.


import java.awt.Color;
import java.awt.Graphics;

import javax.swing.*;


public class GraphicsTut extends JFrame{

public GraphicsTut(){
this.setTitle("Remember g for Graphics");
this.setSize(500,500);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setVisible(true);

}
public void paint(Graphics g){
g.setColor(Color.BLACK);
g.drawRect(40, 40, 30, 30);
g.setColor(Color.RED);
g.drawOval(80, 80, 30, 30);
g.fillArc(140, 140, 30, 30, 180, 10);
g.drawLine(100, 300, 350, 400);

}

public static void main(String[] args){
new GraphicsTut();

}

}


On this page of the site you can watch the video online Java programming part 90 Graphics : Java drawLine with a duration of hours minute second in good quality, which was uploaded by the user Redemptie 28 June 2012, share the link with friends and acquaintances, this video has already been watched 8,423 times on youtube and it was liked by 17 viewers. Enjoy your viewing!