public
Description: A multiplayer chess game that can be played over a network.
Homepage:
Clone URL: git://github.com/weijie90/international-chess.git
weijie90 (author)
Tue Sep 30 23:46:07 -0700 2008
commit  625a820fe6f5d274ed687a87f4d392c6062e7c70
tree    29f5caa9ca255235426eb620abd8863a111c1dfe
parent  f5fc268e00108d8ade7ebfd1b895bbce19b76ea2
international-chess / FixedSizeJPanel.java
100644 25 lines (22 sloc) 0.669 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/****************
* Name: Koh Wei Jie
*
* Purpose of this file: To define a fixed-size GUI panel class that inherits from JPanel.
*
****************/
import java.awt.*;
import javax.swing.*;
 
public class FixedSizeJPanel extends JPanel{
    private Dimension size;
    public FixedSizeJPanel(Dimension size){
        super();
        this.size = size;
    }
    public FixedSizeJPanel(int width, int height){
        super();
        this.size = new Dimension(width, height);
    }
 
    public Dimension getMinimumSize(){ return this.size; }
    public Dimension getMaximumSize(){ return this.size; }
    public Dimension getPreferredSize() { return this.size; }
}