Solved

To increase thickness of the line

Posted on 1997-12-16
2
2,197 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
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.
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 …
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…

705 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

18 Experts available now in Live!

Get 1:1 Help Now