Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: how to position graphics

  1. #1
    Member
    Join Date
    May 2011
    Posts
    61
    My Mood
    Busy
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default how to position graphics

    Hi,
    if I want to build a binary search tree, I want to create simple sorting animation and for it to draw node with the numeric data, the problem I have is how to position the nodes to be looking like a tree because the more levels there are (depth), the more nodes occupy each level so I need to have longer left and right links to connect the children nodes but I'm not the best with math, it should be simple. But any simple suggestions would be appreciated.


  2. #2
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,424
    My Mood
    Hungover
    Thanks
    144
    Thanked 636 Times in 540 Posts

    Default Re: how to position graphics

    I'd recommend you get out a piece of paper and a pencil and draw out a bunch of examples. You'll eventually start to notice a pattern that you can use to lay things out.
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

Similar Threads

  1. Tabs' position of JTabbedPane
    By hamisto90 in forum AWT / Java Swing
    Replies: 2
    Last Post: November 9th, 2012, 03:29 AM
  2. How to get Mouse Position even if it is not within our application?
    By Freaky Chris in forum Java Programming Tutorials
    Replies: 2
    Last Post: January 4th, 2012, 10:57 AM
  3. Graphics class NullPointerException Initialize Graphics Class??
    By bglueck in forum What's Wrong With My Code?
    Replies: 7
    Last Post: May 13th, 2011, 11:13 PM
  4. [SOLVED] last character position
    By nasi in forum AWT / Java Swing
    Replies: 2
    Last Post: May 1st, 2010, 05:31 AM
  5. How to get Mouse Position even if it is not within our application?
    By Freaky Chris in forum Java Code Snippets and Tutorials
    Replies: 0
    Last Post: April 29th, 2009, 12:41 PM