如何清理面板中两点之间的线
你好 我有一个面板,您可以在其中放置一些点,然后通过单击按钮,将在点之间绘制线条。还有一个按钮,当您单击它时,所有线条将被删除,点将显示在面板上(只是删除了行)我该怎么做。 有什么特殊的方法吗? 谢谢
我与 netbeans 合作,AWT
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
选项一:再次绘制线条,只是这次使用“背景颜色”。如果您的背景不是纯色,这将不起作用。
选项二:重画一切,不画线条。效率不是很高,但如果你有复杂的背景(文本、图像等),它确实是你唯一的选择。
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).