How can I write a dynamic frame program via Java? [closed]
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.
精彩评论