1

How to render JPanel which contains the child components and that don't exist as part of the visible containment hierarchy (i.e. panel has no parent)?

Method SwingUtilities.paintComponent() render only panel without the child components.

And how to handle mouse events by this panel?

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
mgukov
  • 493
  • 5
  • 18
  • 3
    what are you trying to achieve? – kleopatra Oct 11 '12 at 09:33
  • See [Why does the JTable header not appear in the image?](http://stackoverflow.com/questions/7369814/why-does-the-jtable-header-not-appear-in-the-image) for tips on rendering components without displaying them. – Andrew Thompson Oct 11 '12 at 09:46
  • If you're trying to render the panel to a printer to buffer, you should use `print` or `printAll` instead, but we need some context – MadProgrammer Oct 11 '12 at 09:52

1 Answers1

1

Method SwingUtilities.paintComponent() renper only panel without the child components.

mKorbel
  • 109,525
  • 20
  • 134
  • 319