简体   繁体   English

如何清理面板中两点之间的线

[英]how can I clean the line between two points in a panel

Hi I have a panel that you can put some points one it and by clicking on a button ,lines will be drawn between points.also there is a button that when you click on it ,all lines will be deleted and points will be on your panel (just lines are deleted) how can I do this. 嗨,我有一个面板,您可以在其中放置一些点,然后单击按钮,将在各点之间绘制线条。还有一个按钮,当您单击它时,所有线都将被删除并且点将出现在您的面板上面板(仅删除行)我该怎么做。 is there any special method for this? 有什么特殊的方法吗? thanks 谢谢

I work with netbeans ,AWT 我与netbeans合作,AWT

Option one: Draw the lines again, only this time in the "background color". 选项一:再次绘制线条,仅这次以“背景色”绘制。 This won't work if your background isn't a solid color. 如果您的背景不是纯色,则此方法将无效。

Option two: Redraw Everything, without the lines. 选项二:重画所有内容,无线条。 Not very efficient, but it really your only option if you have a complex background (text, images, etc). 效率不是很高,但是如果您有复杂的背景(文本,图像等),这实际上是您唯一的选择。

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

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