简体   繁体   English

Java:如何处理图形?

[英]Java: How to deal with graphics?

I am developing a small desktop application in Java using NetBeans. 我正在使用NetBeans用Java开发小型桌面应用程序。 Since i am new to java so i mostly drag and drop controls and work with them. 由于我是Java的新手,所以我主要拖放控件并使用它们。 What i have in my application is JFrame, on that JFrame i place one JScrollPane where i am displaying some textual information. 我在应用程序中拥有的是JFrame,在该JFrame上放置了一个JScrollPane,用于显示一些文本信息。

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. 现在,我在上面的下方添加了另一个JScrollPane,并希望绘制一些圆角矩形,然后将这些矩形与虚线连接起来。 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 一些指向优秀教程的链接也将有所帮助

First you should forget immediately and forever about existence of drag-and-drop visual tools that generate UI in java. 首先,您应该立即永久忘记使用Java生成UI的拖放可视化工具的存在。 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. 您必须是Java UI的专家,才能对此类代码进行微小的更改。

Second, google "java ui programming". 其次,谷歌“ java ui编程”。 This is what I did for you. 这就是我为你做的。 Here are some links I can recommend. 我可以推荐一些链接。

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

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

http://csis.pace.edu/~bergin/sol/java/gui/ 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. 祝好运。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM