Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

[java] Java2D Graphics and Panel

This topic is 5150 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi everyone, I have to write a graphic editor for my studies. The graphic programmation is new for me. I''ve realized something that I''m proud enough for a first try. But my editor suffers from a borring default. I will explain it later. I''ve often asking help on IRC or on Newsgroups but I didn''t receive any useful answer. My problem don''t seem to be the hardest ever seen. For the drag and drop in my editor I use about the same classes that in this source file: (3 classes, maximum 100 sentences of source codes !!! don''t be afraid please !!! ) http://www.javagalaxy.com:8080//DnD/up/javagalaxy3ComponentDnD.zip What I would like to realized it would be able to draw lines between the panels with the methods Graphics.drawline() But I''e got superposition problem. Ideally the lines must move with the DND of the panel. ps: for now, my temporaly solution is a graphics thread wich loop always (not cool) and draw this lines. I can''t use a backbuffer to avoir the clipping effect with this solution too. Thank you in advance for the interest you gave to my problem. Butch.

Share this post


Link to post
Share on other sites
Advertisement
You wish to draw a line between 2 panels? Java.awt.Panel?

I suppose you can only get the events in the Panel that has the focus. You should find the relative position of the 2nd panel, and draw a part of the line on the 2nd panel if the cursor is above it.

[edited by - koroljov on April 13, 2004 2:47:31 PM]

Share this post


Link to post
Share on other sites
Or make the panels transparent and draw on the underlying container.



First make it work, then make it fast. --Brian Kernighan

The problems of this world cannot possibly be solved by skeptics or cynics whose horizons are limited by the obvious realities. We need men and women who can dream of things that never were. - John Fitzgerald Kennedy(35th US President)

Do not interrupt your enemy when he is making a mistake. - Napolean Bonaparte

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!