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

What does the keyword "synchronize" mean in java, What does the keyword " s...

What does the keyword " synchronize " mean in java. What are the usage and disadvantages of synchronization?

Java script, var temp =14; var y = 2; temp document.write(temp);

var temp =14; var y = 2; temp document.write(temp);

Give an examples of access protection, Give an Examples of Access Protectio...

Give an Examples of Access Protection ? This is how the Car class would almost certainly be written in practice. Remember that all the fields are now declared private, and the

Vehicle loan application - weblogic administrator, Vehicle Loan Application...

Vehicle Loan Application: Type                                         Web-based Application Role                                          Weblogic administrator + develop

Online Music Store, Online music store that stores information about song, ...

Online music store that stores information about song, artist, album, customer, playlist. Also all necessary diagrams - use case, uml, erd

Why do we call javascript an object-based language, Why do we call JavaScri...

Why do we call JavaScript an Object-based Language? In java language an JavaScript shares several similarities with object-oriented languages, and thus is known as an object-ba

Need minecraft bukkit plugin programmer, Need Minecraft Bukkit Plugin Progr...

Need Minecraft Bukkit Plugin Programmer I want to make my own server for Minecraft. I am in need of a experts to make custom bukkit plugins for my server. But basically I will w

Define the n-tier architecture or j2ee 3-tier?, Normal 0 false ...

Normal 0 false false false EN-US X-NONE X-NONE

Demonstrate java client and server , There is no separate homework this wee...

There is no separate homework this week, but you may complete the exercises ahead of time, in which case you only need to attend for long enough to get your work marked off by your

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