Solved

To increase thickness of the line

Posted on 1997-12-16
2
2,208 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Suggested Courses

632 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