validate() doesn't work! why?
I installed JDK6 for demos in Java2D tutorial-but copiles with 5.0.9.
I made custom JComponent and override paint(Graphics g) to draw user command - draw, fill, etc. And to display my component through JSplitPane, add to its viewport and call viewport's validate(). It occurs no change. But when I move divider, it displays on screen.
someone help me~ why only move divider event can display my custom component? frame iconified, deiconified, activate, or etc. can not display it.
[500 byte] By [
enoaa] at [2007-11-26 13:10:09]

# 1
There are many ways to get into trouble in putting things together like this. Some basic hints for now.
Provide a size hint for your graphic component, for example, call setPreferredSize on it or inside its class constructor, or, override the getPreferredSize method in the class and return the Dimension that you want. The components parent conatiner needs this information to know what to do with it.
Override paintComponent for your graphic component, not paint. Look up the paint method in the JComponent api Method Detail to learn why.
Usually we call revalidate (JComponent method) on the component theat needs the new/updated display, so this may be your graphic component. There is a lot of room for trial and error in this area; you just have to experiment to learn how to make it work.