Java: How to deal with graphics?

南楼画角 提交于 2019-12-11 19:47:16

问题


I am developing a small desktop application in Java using NetBeans. Since i am new to java so i mostly drag and drop controls and work with them. What i have in my application is JFrame, on that JFrame i place one JScrollPane where i am displaying some textual information.

Now i added an other JScrollPane below the above and want to draw some rounded rectangle and then connecting those rectangles with the dotted lines. I also want to put little text in each rectangle.

I need guidance from where do i start to achieve the above task? Some links to good tutorials will also be helpful


回答1:


Java graphics tutorial.

http://download.oracle.com/javase/tutorial/2d/basic2d/index.html
http://www.realapplets.com/tutorial/DrawExample.html
http://www.apl.jhu.edu/~hall/java/Java2D-Tutorial.html
http://www.deitel.com/articles/java_tutorials/20050923/IntroductionToJava2D_Page2.html




回答2:


First you should forget immediately and forever about existence of drag-and-drop visual tools that generate UI in java. These tools generate code that cannot be changed. You have to be an expert in java UI to make even minor changes in such code.

Second, google "java ui programming". This is what I did for you. Here are some links I can recommend.

http://www.codeproject.com/KB/java/Graphics.aspx

http://download.oracle.com/javase/tutorial/uiswing/

http://csis.pace.edu/~bergin/sol/java/gui/

It takes a couple of hours to get into the terms and the concepts. Then you can start designing and coding. Good luck.



来源:https://stackoverflow.com/questions/7964266/java-how-to-deal-with-graphics

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!