add(text_4);
text_4.setBounds(315,5,90,24);
text_4.addFocusListener(this);
text_4.setEditable(true);
add(button);
button.setBounds(35,36,60,26);
button.setEnabled(false);
button.addActionListener(this);
add(text_1);
text_1.setBounds(115,36,90,24);
text_1.setEnabled(false);
text_1.setEditable(false);
add(text_2);
text_2.setBounds(315,36,90,24);
text_2.setEnabled(false);
text_2.setEditable(false);
setSize(440,440);
setLayout(null);
setBackground(Color.orange);
addMouseListener(this);
}
publicvoidpaint(Graphicsg)
{
for(inti=80;i<=400;i=i+20)
{
g.drawLine(40,i,400,i);
}
g.drawLine(40,420,400,420);
for(intj=40;j<=380;j=j+20)
{
g.drawLine(j,80,j,420);
}
g.drawLine(400,80,400,420);
g.fillOval(97,137,6,6);
g.fillOval(337,137,6,6);
g.fillOval(97,377,6,6);
g.fillOval(337,377,6,6);
g.fillOval(217,257,6,6);
}
publicvoidfocusGained(FocusEvente)
{
Componentcom=(Component)e.getSource();
if(com==text_3)
{
text_3.setText("");
}
elseif(com==text_4)
{
text_4.setText("");
}
}
publicvoidfocusLost(FocusEvente)
{
}
publicvoidmousePressed(MouseEvente)
{
if(blackname.length()==0||whitename.length()==0)