hi all
i m making chess in java and have a problem. Plz if u can help me out.
Problem is when i add a JPanel to a JFrame it sets the size of JPanel given by me in the code. but when i add another JPanel then it automatically manages the size. and makes the size of both jpanels equal. and does not set the size given by me.
plz help me out if u can. must b very thankful
public class Chess extends javax.swing.JFrame
{
private Board board;
private String curr_player;
private String []turn;
JPanel pane,p;
/** Creates new form Chess */
public Chess()
{
initComponents();
pane.setBackground(Color.red);
//pane.setVisible(true);
board = new Board();
board.setBounds(0,0,600, 600);
setSize(700,700);
/////////////////////////////////////////////////////
p = new JPanel();
p.setSize(100, 100);
pane = new JPanel();
pane.setSize(100, 100);
add(board);
add(pane);
add(p);
validate();
;