A JPanel instead of a Canvas reduces the flickering.
authorMarkus Bröker <mbroeker@largo.homelinux.org>
Fri, 17 Dec 2010 16:56:54 +0100
changeset 12 d28c1e402d82
parent 11 1afe167876fb
child 13 f83884cc7d2f
A JPanel instead of a Canvas reduces the flickering. Thanks to JavaDev for this improvement!
org/homelinux/largo/games/board/Board.java
--- a/org/homelinux/largo/games/board/Board.java
+++ b/org/homelinux/largo/games/board/Board.java
@@ -5,14 +5,15 @@
 
 package org.homelinux.largo.games.board;
 
-import java.awt.Canvas;
 import java.awt.Color;
 import java.awt.Dimension;
 import java.awt.Graphics;
 import java.awt.Image;
 import java.util.Vector;
 
-public class Board extends Canvas {
+import javax.swing.JPanel;
+
+public class Board extends JPanel {
 	static final long serialVersionUID = 140208;
 
 	protected boolean UNDO_DEBUG  = false;