Forums Register Login

Code Not Working!!! Can you please say y this code is not working?

+Pie Number of slices to send: Send
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package chess;
import java.awt.*;
import javax.swing.*;

public class Chess {
public static void main(String[] args)
{
board obj=new board();



}
}
class board extends JPanel
{
JFrame fr = new JFrame("CHESS");
JPanel pan=new JPanel();
Container con=new Container();

@Override
public void paintComponent (Graphics g)
{
System.out.println("HI");
/*fr.setSize(800, 800);
fr.add(con);
g.drawRect(10, 10, 100, 100);
*/
/* int x=0,y=0;
fr.setSize(800, 800);
fr.add(con);
for(int i=0;i<4;i++)
{
for(int j=0;j<4;j++)
{
x=i*100;
y=j*100;
g.fillRect(x, y , 100 , 100);
}
}
fr.add(con);
fr.setVisible(true);*/
System.out.println("PRATIK... Happy ? ");
}
void draw()
{
fr.add(pan);
pan.add(con);

}
}
+Pie Number of slices to send: Send
I can say that this code has absolutely nothing whatsoever to do with JavaServer Faces.
+Pie Number of slices to send: Send
And I can say ItDoesntWorkIsUseless
We're being followed by intergalactic spies! Quick! Take this tiny ad!
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1131 times.
Similar Threads
Chessboard-Newbie Question
display image in jpanel
Swing: Adding components to containers
Help with alternating colors correctly on chess board
chess game : moving piece
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 11:41:26.