draw thick line without using Graphics2D

Discussion in 'Java' started by SPG, Feb 15, 2005.

  1. SPG

    SPG Guest

    Hi,

    We have an applet that MUST support jvm 1.1 (MS JVM also).
    I want to plot some lines, and the selected line needs to be two points
    thick.

    Simple to do with Graphics2D (setStroke(new BasicStroke(2)), but this is not
    supported with the older JVMs.

    Is there another way to do this?

    Steve
    SPG, Feb 15, 2005
    #1
    1. Advertising

  2. "SPG" <> wrote in message
    news:9ZmQd.15131$...
    > Hi,
    >
    > We have an applet that MUST support jvm 1.1 (MS JVM also).
    > I want to plot some lines, and the selected line needs to be two points
    > thick.
    >
    > Simple to do with Graphics2D (setStroke(new BasicStroke(2)), but this is

    not
    > supported with the older JVMs.
    >
    > Is there another way to do this?


    If the line is horizontal or vertical, fill a rectangle. If the line must
    be arbitrary, draw 4 parallel lines by offsetting the endpoints by (0,0),
    (0,1), (1,0), (1,1). (You can do this with 2 lines, but you have to change
    the offsets for different angles and it may still leave gaps.)

    Cheers,
    Matt Humphrey http://www.iviz.com/
    Matt Humphrey, Feb 15, 2005
    #2
    1. Advertising

  3. SPG

    SPG Guest

    Hi,

    Thanks.. Unfortunately the lines are not horizontal, but I cna apply that
    method anyhow as I know the endpoints so I can just add one and redraw..

    Will have a go anyway..

    Steve

    "Matt Humphrey" <> wrote in message
    news:...
    >
    > "SPG" <> wrote in message
    > news:9ZmQd.15131$...
    >> Hi,
    >>
    >> We have an applet that MUST support jvm 1.1 (MS JVM also).
    >> I want to plot some lines, and the selected line needs to be two points
    >> thick.
    >>
    >> Simple to do with Graphics2D (setStroke(new BasicStroke(2)), but this is

    > not
    >> supported with the older JVMs.
    >>
    >> Is there another way to do this?

    >
    > If the line is horizontal or vertical, fill a rectangle. If the line must
    > be arbitrary, draw 4 parallel lines by offsetting the endpoints by (0,0),
    > (0,1), (1,0), (1,1). (You can do this with 2 lines, but you have to change
    > the offsets for different angles and it may still leave gaps.)
    >
    > Cheers,
    > Matt Humphrey http://www.iviz.com/
    >
    >
    SPG, Feb 15, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kevin
    Replies:
    3
    Views:
    10,455
    Kevin
    Jan 5, 2005
  2. marss
    Replies:
    22
    Views:
    4,673
    dorayme
    Jul 14, 2007
  3. wookashs
    Replies:
    1
    Views:
    575
    ownowl
    May 4, 2008
  4. Ian Collins
    Replies:
    4
    Views:
    1,616
  5. Dann Corbit
    Replies:
    2
    Views:
    1,246
    Seebs
    Apr 12, 2010
Loading...

Share This Page