由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Java版 - how to paint on a Jpanel?
相关主题
为啥画不出来?override/overload/overwrite in Java
Re: JPanel help!画多边形怎么实现?
suggestion needed for graph如何在TextArea里面画位图
请教BufferedImage中的setColor问题。JTextArea行间距如何设定?
怎么控制paint?How to scroll an JInternalFrame
questions on repaint()Java Telnet Client Implementation v0.991Beta
Java banned operator overloadingsimple swing question
用java画直线的问题swing紧急求助
相关话题的讨论汇总
话题: jpanel话题: paint话题: graphics话题: idea
进入Java版参与讨论
1 (共1页)
d******n
发帖数: 83
1
I only know to paint an applet. And I know there is a method named
paintComponent(Graphics page) which belongs to JComponent. But I have no idea
how to paint on a Jpanel or Jlabel. Any idea? THANKS!!!
c*****t
发帖数: 1879
2
If you subclass JPanel, you overload paintComponent(Graphics g) function.
However, the first line of the function should be super.paintComponent(g).

【在 d******n 的大作中提到】
: I only know to paint an applet. And I know there is a method named
: paintComponent(Graphics page) which belongs to JComponent. But I have no idea
: how to paint on a Jpanel or Jlabel. Any idea? THANKS!!!

d******n
发帖数: 83
3
能不能说得更详细一些呢?
我确实 overload le paintComponent(Graphics g) function.
and the first line of the function is super.paintComponent(g).
But I have several Jpanels in that application, how to display
what I paint on the specified Jpanel which I really want?

idea

【在 c*****t 的大作中提到】
: If you subclass JPanel, you overload paintComponent(Graphics g) function.
: However, the first line of the function should be super.paintComponent(g).

1 (共1页)
进入Java版参与讨论
相关主题
swing紧急求助怎么控制paint?
急急急, 怎么实现reload pagequestions on repaint()
Help with Java Swing AppletJava banned operator overloading
GUI 画匡的那个叫什么?用java画直线的问题
为啥画不出来?override/overload/overwrite in Java
Re: JPanel help!画多边形怎么实现?
suggestion needed for graph如何在TextArea里面画位图
请教BufferedImage中的setColor问题。JTextArea行间距如何设定?
相关话题的讨论汇总
话题: jpanel话题: paint话题: graphics话题: idea