Re: GUI Graphics: draw a line between two pre-specified points

Discussion in 'Java' started by Yasir Khalifa, Jun 28, 2004.

  1. Hi:
    Any help to the following GUI-graphics problem is greatly appreciated!

    I want to draw a line between a pair of points (the first point represents
    an input to a math
    function, and the 2nd point represents the output of the function). The pair
    of points are already
    pre-specified in a GUI. This could be looked at as multiple number of input
    points, and similarly
    a multiple number of output points. This means that I need to draw multiple
    lines between the two
    sets of (I/O) pairs that look like the mapping (behavior) of the function
    that to be represented
    graphycally.

    i.e. the overall picture graphically should look like this [i.e. f(x) = x
    +2]:
    "1 ---------------->3"
    " |------->4"
    "3 -----| | "
    "2 -----|---|------->5"

    (a line from 1-->3, 3--->5, and 2-->4)

    Any pointers?
    Many thanks in advance.
    -Yasir
     
    Yasir Khalifa, Jun 28, 2004
    #1
    1. Advertising

  2. On Mon, 28 Jun 2004 18:10:40 -0400, Yasir Khalifa wrote:

    > I want to draw a line between a pair of points


    <http://java.sun.com/j2se/1.4.2/docs/api/java/awt/Graphics.html#drawLine(int,%20int,%20int,%20int)>

    Please direct such question to c.l.j.help
    <http://www.physci.org/codes/javafaq.jsp#cljh>

    --
    Andrew Thompson
    http://www.PhySci.org/ Open-source software suite
    http://www.PhySci.org/codes/ Web & IT Help
    http://www.1point1C.org/ Science & Technology
     
    Andrew Thompson, Jun 29, 2004
    #2
    1. Advertising

  3. Yasir Khalifa

    Roedy Green Guest

    On Mon, 28 Jun 2004 18:10:40 -0400, "Yasir Khalifa"
    <> wrote or quoted :

    >I want to draw a line between a pair of points (the first point represents
    >an input to a math


    see http://mindprod.com/jgloss/canvas.html

    --
    Canadian Mind Products, Roedy Green.
    Coaching, problem solving, economical contract programming.
    See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
     
    Roedy Green, Jun 29, 2004
    #3
  4. Yasir Khalifa wrote:
    > Any help to the following GUI-graphics problem is greatly appreciated!


    I suggest you work through Sun's Java 2D tutorial for a start:

    http://java.sun.com/docs/books/tutorial/2d/

    There are more pointers to resources in the comp.lang.java.gui FAQ,
    especially about the painting model and the Swing architecture. I
    suggest you read them, too.

    /Thomas
     
    Thomas Weidenfeller, Jun 29, 2004
    #4
    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. Rocky Moore
    Replies:
    7
    Views:
    1,778
    mikeb
    Jan 14, 2004
  2. Rick
    Replies:
    3
    Views:
    1,479
    Sandip Chitale
    Sep 30, 2003
  3. n_o_s_p_a__m

    possible to draw a line between two ImageButton WebControls?

    n_o_s_p_a__m, Oct 31, 2003, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    154
    n_o_s_p_a__m
    Nov 26, 2003
  4. Replies:
    1
    Views:
    252
    Randy Webb
    Aug 25, 2006
  5. Replies:
    2
    Views:
    127
Loading...

Share This Page