Explain about drawing lines, JAVA Programming

Assignment Help:

Explain about Drawing Lines?

Drawing straight lines along with Java is easy. Just call
g.drawLine(x1, y1, x2, y2)
where (x1, y1) and (x2, y2) are the endpoints of your lines and g is the Graphics object you're drawing along with.
This program draws a line diagonally across the applet.
import java.applet.*;
import java.awt.*;

public class SimpleLine extends Applet {

public void paint(Graphics g) {

g.drawLine(0, 0, this.getSize().width, this.getSize().height);

}

}
Here's the result

 


Related Discussions:- Explain about drawing lines

Project, Hey, i have a project on java can you help me

Hey, i have a project on java can you help me

Padovan String, A Padovan string P(n) for a natural number n is defined as:...

A Padovan string P(n) for a natural number n is defined as: P(0)=''X'' P(1)=''Y'' P(2)=''Z'' for a string characters ''X'',''Y'',''Z'' only,and given value of n,write a program th

I want crime management website, I want Crime Management website Project...

I want Crime Management website Project Description: It is a web based project build in J2EE as front end and Oracle as back end for peoples so they will register complaints

Explain rmi architecture, RMI uses a layered architecture; every of the lay...

RMI uses a layered architecture; every of the layers could be increased or replaced without affecting the rest of the system. The details of layers can be summarised as follows:

Code, pls telme source code for Padovan String

pls telme source code for Padovan String

Publish subscribe model and p2p model, What is the basic difference among P...

What is the basic difference among Publish Subscribe model and P2P model? Ans) Publish Subscribe model is typically used in one-to-many situation. It is unreliable but very quic

Visa resolve online - websphere administrator, Visa Resolve Online and Heal...

Visa Resolve Online and Health Care Project: Visa Resolve Online In this project there are few modules like TRANSACTION INQUIRY,CHARGEBACK , REPRESENTMENT, ARBITRATION .

I want to develop a chat application for j2me, I want to develop a Chat app...

I want to develop a Chat application for j2me Project Description: We require a chat application for a community website. Skills required: Java, J2ME

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd