summaryrefslogtreecommitdiffstats
path: root/src/jrummikub/view/Board.java
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2011-04-28 16:49:20 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2011-04-28 16:49:20 +0200
commit2a4e4f0a8395b1762abaa28d81639fe23d063b48 (patch)
tree3ccd63a87e035c2b27084c92baddc16c44522f11 /src/jrummikub/view/Board.java
parent082b699c326f219d78c9269a7a9b53c066489c4d (diff)
downloadJRummikub-2a4e4f0a8395b1762abaa28d81639fe23d063b48.tar
JRummikub-2a4e4f0a8395b1762abaa28d81639fe23d063b48.zip
Added wood texture to board
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@11 72836036-5685-4462-b002-a69064685172
Diffstat (limited to 'src/jrummikub/view/Board.java')
-rw-r--r--src/jrummikub/view/Board.java17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/jrummikub/view/Board.java b/src/jrummikub/view/Board.java
index 70c0988..b73b00a 100644
--- a/src/jrummikub/view/Board.java
+++ b/src/jrummikub/view/Board.java
@@ -1,12 +1,27 @@
package jrummikub.view;
import java.awt.Color;
+import java.awt.Graphics;
+import javax.swing.ImageIcon;
import javax.swing.JPanel;
@SuppressWarnings("serial")
public class Board extends JPanel implements IBoard {
+ private final static ImageIcon background = new ImageIcon(Board.class.getResource("resource/wood.png"));
+
Board() {
- setBackground(Color.DARK_GRAY);
+ super(true);
+
+ setBorder(new CustomBorder(Color.DARK_GRAY, 0, 1, 0, 1));
+ }
+
+ @Override
+ protected void paintComponent(Graphics g) {
+ for(int x = 0; x < getWidth(); x += background.getIconWidth()) {
+ background.paintIcon(this, g, x, 0);
+ }
+
+ // TODO Rest of painting code
}
}