If you draw a horizontal line along the same y coordinate as the baseline of a line of text, that line is drawn entirely below the text, except for any descenders. All coordinates that appear as arguments to the methods of this Graphics object are considered relative to the translation origin of this Graphics object prior to the invocation of the method.
Jul 08, 2019 · The following code snippet show you how to draw a simple line using Graphics2D.draw() method. This method take a parameter that implements the java.awt.Shape interface.. To draw a line we can use the Line2D.Double static-inner class. Largest collection of java problems, exercises and solutions online! More than 800+ posts! Search now! 1. Create a program in JAVA where you can play with turtles. Draw a line on the screen using the turtle package. 2. Draw a square on the screen. Change its color. Make the line thicker by changing the pensize. Change the speed the turtle draws. 3. It’s possible to move the turtle without drawing. Draw two squares on the screen that don’t touch