This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes JSF and the fly likes Code Not Working!!! Can you please say y this code is not working? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Code Not Working!!! Can you please say y this code is not working?" Watch "Code Not Working!!! Can you please say y this code is not working?" New topic
Author

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

Prats Shah
Greenhorn

Joined: Feb 28, 2013
Posts: 9
/*
* 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);

}
}
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15639
    
  15

I can say that this code has absolutely nothing whatsoever to do with JavaServer Faces.


Customer surveys are for companies who didn't pay proper attention to begin with.
Joanne Neal
Rancher

Joined: Aug 05, 2005
Posts: 3169
    
  10
And I can say ItDoesntWorkIsUseless


Joanne
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Code Not Working!!! Can you please say y this code is not working?
 
Similar Threads
Chessboard-Newbie Question
display image in jpanel
chess game : moving piece
Help with alternating colors correctly on chess board
Swing: Adding components to containers