Solved

To increase thickness of the line

Posted on 1997-12-16
2
2,201 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 AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
maven project error 5 56
Groovy problem when using SOAPUI : DispatchException occurred 7 45
How to convert String matching to regex in java 4 33
Java: anonymous class 4 21
For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
For customizing the look of your lightweight component and making it look lucid like it was made of glass. Or: how to make your component more Apple-ish ;) This tip assumes your component to be of rectangular shape and completely opaque. (COD…
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 one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:

777 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