IT. Expert System.

Java basics

drawLine()


Used to draw a straight line from point (x1,y1) to (x2,y2).

Syntax:
drawLine(int x1, int y1, int x2, int y2)


Example:

/* Draw Line in Applet Window Example This java example shows how to draw lines in an applet window using drawLine method of Graphics class.*/
/*
*/
 import java.applet.Applet;
import java.awt.Graphics; 
public class DrawLineExample extends Applet{
         public void paint(Graphics g){
                               /* to draw line in an applet window use,
                 * void drawLine(int x1,int y1, int x2, int y2)
                 * method.
                 *
                 * This method draws a line between (x1,y1) and (x2,y2)
                 * coordinates in a current color.
                 */
                //this will draw a line between (10,10) and (50,50) coordinates.
                g.drawLine(10,10,50,50);
                               //draw vertical line
                g.drawLine(10,50,10,100);
                               //draw horizontal line
                g.drawLine(10,10,50,10);
        }
}


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 654 / 158861927. Delta: 0.00282 с