Preview 50% of the Answer Below
Due to formatting, images, tables, or paragraphs may be out of place or not shown. Rest assured that they will be included and formatted correctly in your purchased answer.
Details
Answer Preview
);b1=newJButton("1"); b2=newJButton(""); b3=newJButton("3"); b4=newJButton("4"); b5=newJButton("5"); b6=newJButton("6"); b7=newJButton("7"); b8=newJButton("8"); b9=newJButton("2"); next=newJButton("next"); b1.setBounds(10,30,50,40); b2.setBounds(70,30,50,40); b3.setBounds(130,30,XX,40); XX.XXXXXXXXX(XX,XX,50,XX); b5.setBounds(XX,XX,50,40); b6.XXXXXXXXX(XXX,XX,XX,XX); b7.XXXXXXXXX(XX,XXX,XX,XX); XX.setBounds(70,130,XX,40); b9.setBounds(130,130,50,40); next.XXXXXXXXX(70,XXX,100,XX); add(b1);add(b2);add(XX);add(b4);add(XX);add(XX);add(XX);add(b8);add(b9);add(XXXX); XX.XXXXXXXXXXXXXXXXX(this); b2.addActionListener(this); b3.addActionListener(this); XX.addActionListener(XXXX); XX.addActionListener(XXXX); XX.addActionListener(XXXX); XX.addActionListener(XXXX); b8.addActionListener(this); XX.XXXXXXXXXXXXXXXXX(XXXX); next.XXXXXXXXXXXXXXXXX(this); next.setBackground(Color.black); XXXX.setForeground(XXXXX.green); setSize(XXX,XXX); XXXXXXXXX(null); XXXXXXXXXX(XXXX); setDefaultCloseOperation(JFrame.XXXXXXXXXXXXX); }//endofconstructor XXXXXXvoidactionPerformed(XXXXXXXXXXXX){ XX(e.XXXXXXXXX()==XXXX){ XXXXXXX=XX.getLabel(); XX.setLabel(b9.getLabel()); b9.setLabel(s); s=XX.XXXXXXXX(); XX.setLabel(b5.getLabel()); XX.XXXXXXXX(s); s=b2.getLabel(); b2.setLabel(b7.XXXXXXXX()); b7.setLabel(s); } if(e.XXXXXXXXX()==XX){ Strings=XX.XXXXXXXX(); XX(b2.XXXXXXXX().equals("")){XX.XXXXXXXX(s);XX.XXXXXXXX("");} elseif(b4.XXXXXXXX().equals("")){XX.setLabel(s);b1.setLabel("");} }//XXXXXXX if(e.getSource()==XX){ Strings=b3.getLabel(); if(XX.XXXXXXXX().equals("")){b2.setLabel(s);b3.XXXXXXXX("");} elseif(b6.getLabel().equals("")){XX.setLabel(s);b3.setLabel("");} }//XXXXXXX XX(e.XXXXXXXXX()==XX){ Strings=XX.getLabel(); XX(b1.getLabel().XXXXXX("")){XX.setLabel(s);b2.setLabel("");} XXXXif(XX.getLabel().equals("")){b3.XXXXXXXX(s);XX.setLabel("");} elseXX(XX.XXXXXXXX().equals("")){b5.XXXXXXXX(s);XX.setLabel("");} }//endofif if(e.getSource()==XX){ XXXXXXX=XX.XXXXXXXX(); if(XX.getLabel().XXXXXX("")){XX.setLabel(s);b4.XXXXXXXX("");} XXXXXX(XX.XXXXXXXX().XXXXXX("")){XX.setLabel(s);XX.XXXXXXXX("");} XXXXXX(XX.XXXXXXXX().equals("")){XX.XXXXXXXX(s);b4.setLabel("");} }//endofif XX(e.getSource()==b5){ XXXXXXX=XX.XXXXXXXX(); XX(b2.getLabel().equals("")){XX.XXXXXXXX(s);XX.setLabel("");} XXXXXX(XX.getLabel().equals("")){XX.XXXXXXXX(s);XX.XXXXXXXX("");} XXXXXX(XX.XXXXXXXX().equals("")){b6.setLabel(s);b5.setLabel("");} XXXXif(b8.XXXXXXXX().XXXXXX("")){XX.XXXXXXXX(s);b5.XXXXXXXX("");} }//endofif XX(e.getSource()==b6){ XXXXXXX=XX.XXXXXXXX(); if(b9.getLabel().XXXXXX("")){b9.setLabel(s);XX.setLabel("");} XXXXXX(b3.XXXXXXXX().equals("")){XX.setLabel(s);b6.XXXXXXXX("");} elseXX(b5.getLabel().XXXXXX("")){b5.XXXXXXXX(s);XX.XXXXXXXX("");} }//endofif if(e.XXXXXXXXX()==b7){ Strings=XX.XXXXXXXX(); if(b4.XXXXXXXX().equals("")){XX.setLabel(s);XX.setLabel("");} XXXXif(XX.XXXXXXXX().equals("")){XX.XXXXXXXX(s);XX.XXXXXXXX("");} }//endofif if(e.XXXXXXXXX()==XX){ XXXXXXX=XX.XXXXXXXX(); if(XX.getLabel().equals("")){b7.setLabel(s);XX.XXXXXXXX("");} XXXXXX(b9.XXXXXXXX().XXXXXX("")){b9.XXXXXXXX(s);b8.XXXXXXXX("");} XXXXXX(XX.XXXXXXXX().equals("")){XX.setLabel(s);b8.setLabel("");} }//endofif XX(e.getSource()==XX){ XXXXXXX=b9.XXXXXXXX(); XX(XX.getLabel().XXXXXX("")){XX.setLabel(s);XX.XXXXXXXX("");} XXXXif(XX.getLabel().XXXXXX("")){b8.setLabel(s);b9.XXXXXXXX("");} XX(b1.getLabel().equals("1")&&b2.getLabel().XXXXXX("2")&&XX.XXXXXXXX() .equals("3")&&b4.getLabel().XXXXXX("X")&&b5.XXXXXXXX().XXXXXX("5") &&XX.XXXXXXXX().XXXXXX("X")&&XX.getLabel().equals("X")&&b8.XXXXXXXX() .XXXXXX("8")&&b9.XXXXXXXX().equals("")){ XXXXXXXXXXX.showMessageDialog(puzzle.this,"!!!youwon!!!"); } }//endofif }//XXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXmain(String[]XXXX){ XXXpuzzle(); }//XXXXXXXXX }//endofclass ">