X
Xiaolei Li
Hi,
I'm having an issue with repaint() on a class that extends JPanel.
Basically, the JPanel should repaint itself based on a mouse movement in
another panel (call it X). Everything works properly on my Linux
machine but when I try the same code on my Mac OSX machine, it doesn't
repaint properly.
When the mouse is moved into the proper place in X, the JPanel I want to
repaint does something weird. The area that should change (it draws
some text) changes into this gray shade so it is drawing something.
The JPanel changes its size properly, and the MouseMotion stuff works
correctly, too. If I just resize the entire window or minimize/maximize
it or scroll, the text will show up correctly.
In my code, I just call revalidate() and repaint() on the JPanel. I
did not overwrite those methods, only paintComponent(). TIA.
I'm having an issue with repaint() on a class that extends JPanel.
Basically, the JPanel should repaint itself based on a mouse movement in
another panel (call it X). Everything works properly on my Linux
machine but when I try the same code on my Mac OSX machine, it doesn't
repaint properly.
When the mouse is moved into the proper place in X, the JPanel I want to
repaint does something weird. The area that should change (it draws
some text) changes into this gray shade so it is drawing something.
The JPanel changes its size properly, and the MouseMotion stuff works
correctly, too. If I just resize the entire window or minimize/maximize
it or scroll, the text will show up correctly.
In my code, I just call revalidate() and repaint() on the JPanel. I
did not overwrite those methods, only paintComponent(). TIA.