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).
|
|