开发者

How can I write a dynamic frame program via Java? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. 开发者_开发知识库 Closed 11 years ago.

I want it for showing a graphs in the frame and user be able to put vertex in any point of the page then can connect each points they want, to draw the desired graph and be able to save the information of created graph to rebuild it any time.


Although I am not sure that the question is 100% clear for me I'd try to give you some tips.

There are 2 types of APIs that allow UI programming: AWT and SWING. If there are no special requirements use SWING. It is easy to create frame. Say

JFrame f = new JFrame();
f.setSize(100, 100);
f.setVisible(true);

Now, how to draw graph? You can do it yourself using class Canvas. I think you can find a lot of reference about this. But I believe it is a huge investment to develop a really good component that does what you need. So, I'd recommend you to search for some ready components. The most well-known is JGraph but I believe that 5 minutes search will bring you more results.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜