Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有三个类:CanvasPanel、Drawline 和 DrawRectangle。
这三个类都是扩展JPanel类。
JPanel
所有组件的拖放都很好。但问题是当我将线拖到矩形上时,线已经从矩形后面消失了。你能给我解决方案或给我一些例子,所以我可以理解这是怎么回事。
谢谢
通过调用setOpaque (false)使组件透明。