I'm doing a simple grid which each square is highlighted by the cursor:
[![alt text][1]][1]
[1]: https://i.stack.imgur.com/6S0Bw.png
They are a couple of JPanels, mapgrid and overlay inside a JLayeredPane, with mapgrid on the bottom. Mapgrid just draws on initialization the grid, its paint metodh is:
public void paintComponent(Graphics g) {
super.paintComponent(g);
Graphics2D g2d = (Graphics2D) g;
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON);
for (int i = 0; i
以上就是Java repaint is slow under certain conditions的详细内容,更多请关注web前端其它相关文章!