Solved

To increase thickness of the line

Posted on 1997-12-16
2
2,199 Views
Last Modified: 2008-02-01
How to draw thick line? Is there any method to increase the
thickness of the line...In drawline() method there is no parameter as such to increase the thickness..Please give me
a sample program if there is any..
0
Comment
Question by:geostp
  • 2
2 Comments
 
LVL 2

Accepted Solution

by:
webster030697 earned 50 total points
ID: 1231659
You could use fillRect:

 public abstract void fillRect(int x,
                               int y,
                               int width,
                               int height)

    Fills the specified rectangle. The left and right edges of the rectangle are at x and x + width - 1. The top and
    bottom edges are at y and y + height - 1. The resulting rectangle covers an area width pixels wide by height
    pixels tall. The rectangle is filled using the graphics context's current color.

    Parameters:
        x - the x coordinate of the rectangle to be filled.
        y - the y coordinate of the rectangle to be filled.
        width - the width of the rectangle to be filled.
        height - the height of the rectangle to be filled.

0
 
LVL 2

Expert Comment

by:webster030697
ID: 1231660
Oops! Hit the button to soon.

I was going to add that the above only works for vertical, and horizontal lines (obviously). For lines at some other angle, the only thing I can think of is to draw several lines next to each other.

Otherwise you could write your own thickLine class - there are any number of ways to do this.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now