Draw a line between two dynamic-generated icons

Posted on 2005-05-16
Last Modified: 2010-04-01
Using JSP or HTML how can I draw a line between two images that are dynamically created?  For example I load img1 on certain conditions then I load img2, and I want a line that connects them.

thanks in advance.
Question by:jhughes4

    Author Comment

    any suggestions?
    LVL 29

    Expert Comment

    Create an absolute div that contains an image that joins the two other images. If you have a gif with a transparent background this would work.

    Will you always know where the images are on the page?

    Author Comment

    I guess I would since I would be creating them based on the input from the user.  I'm sorry I'm new to JSP, what is an "absolute div"?  Can you provide a sample?

    LVL 29

    Accepted Solution

    Then look at this:

    You can create a DIV element that you can place absolutley on the page. It's outside of the normal page flow (where elements don't overlap each other) so it can be placed on top of other content. Just put an image of a line in the DIV and there's your joining line.
    LVL 16

    Assisted Solution

    The final output of JSP is just a DHTML page with some limited scripts in god's browsers. Since the page is shown in the browser, you can't control it with JSP, but you can provide something for the page, such as a large image.

    Maybe it's not what you want, but if you can use JSP to adding 2 or more images and links them together with some lines, then save them to an image file and show the image in the page, you're achieved.

    There're a project can do this, it's called "JAI". Here,
    LVL 35

    Expert Comment

    If the images are dynamically created, why not just draw the line on the image before you return it to the browser?

    Author Comment

    Thanks for the suggestions.  I tried the DIV element, but I couldn't get the line "skinny" enough & using what gnoon and TimYates suggested proved to be too difficult to dynamically create since I don't know the number of the images required.  So I decided to go with a tree view instead for the time being...thanks.

    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

    It can often be challenging to stay relevant in the rapidly evolving world of technology. This can make recruiting talent difficult for companies of all sizes.
    In the modern office, employees tend to move around the workplace a lot more freely. Conferences, collaborative groups, flexible seating and working from home require a new level of mobility. Technology has not only changed the behavior and the expe…
    This video discusses moving either the default database or any database to a new volume.
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    734 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

    17 Experts available now in Live!

    Get 1:1 Help Now