Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / November 2006

Tip: Looking for answers? Try searching our database.

Simple 2D API

Thread view: 
bbembi_de@lycos.de - 10 Nov 2006 09:49 GMT
Hello,

I want to display a web like structure in 2D. It would look like a
diagram with lines and text mostly.
Is there a simple API to draw something like that in java?

Thanks.

bye bembi
Andrew Thompson - 10 Nov 2006 10:25 GMT
...
> I want to display a web like structure in 2D. It would look like a
> diagram with lines

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

>...and text mostly.

<http://java.sun.com/j2se/1.5.0/docs/api/java/awt/Graphics.html#drawString(java.l
ang.String,%20int,%20int
)>
<http://java.sun.com/j2se/1.5.0/docs/api/java/awt/Graphics.html#drawString(java.t
ext.AttributedCharacterIterator,%20int,%20int
)>

> Is there a simple API to draw something like that in java?

But then, if you want something slightly more advanced,
look to Graphics2D, where you can set the Stroke etc..
<http://java.sun.com/j2se/1.5.0/docs/api/java/awt/Graphics2D.html>

..or to put that another way.  Did you do the
Java Tutorial section on painting and graphics,
and read the JavaDocs before asking that
question?

Andrew T.
bbembi_de@lycos.de - 10 Nov 2006 15:06 GMT
Thanks for the info!

> ..or to put that another way.  Did you do the
> Java Tutorial section on painting and graphics,
> and read the JavaDocs before asking that
> question?

well actually no.

bye bembi
Oliver Wong - 10 Nov 2006 15:14 GMT
> Thanks for the info!
>
[quoted text clipped - 4 lines]
>
> well actually no.

   I appreciate your honesty. To actually do this yourself will probably be
difficult. Sure, drawing lines and text is easy, but deciding how to
position the lines and text in your image to make it look web-like will
probably be a pain. You might want to look at the following library, but I'm
not sure if it's "simple". I'm not sure that there's an off-the-shelf
solution for the specific problem you're trying to solve.

http://www.jgraph.com/screenshots.html

   - Oliver
bbembi_de@lycos.de - 11 Nov 2006 23:05 GMT
Thanks,

I'll give it a try.

bye bembi


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.