简体   繁体   English

在JPanel上绘画

[英]Painting on JPanel

I got 4 panels in a Frame. 我在一个框架中有4个面板。

North, East, Center and South. 北,东,中和南。

How can I paint on just 1 specific JPanel inside a Frame? 如何在框架中仅在1个特定的JPanel上绘制?

I tried painting but it seems that I am painting in the JFrame 我尝试绘画,但似乎我在JFrame中绘画

Try to create new panel and put it in the center, then override its paintComponent method. 尝试创建新面板并将其放在中心,然后覆盖其paintComponent方法。 see Custom Painting and also here 请参阅自定义绘画 ,也可以在这里

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

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