Skip to main content

Scrambld - Netbeans Java Codes


You can also download text file of this code here:  Scrambld.txt
Java Code:
public class ScrambleWords extends javax.swing.JFrame {
       public ScrambleWords() {
        initComponents();
        check.setVisible(false);  }
    
int count=0;
     String st ="";
private void jLabel1MouseClicked(java.awt.event.MouseEvent evt) {                                     
        count++;
        if(count<=8){
        st=st+jLabel1.getText();
        ans.setText(st);;  }
         if(count>=8)
            check.setVisible(true);
private void jLabel2MouseClicked(java.awt.event.MouseEvent evt) {                                     
        count++;
        if(count<=8){
        st=st+jLabel2.getText();
        ans.setText(st);;
        }
        if(count>=8)
            check.setVisible(true);
    }                                    
    private void jLabel10MouseClicked(java.awt.event.MouseEvent evt) {                                      
        count++;
        if(count<=8){
        st=st+jLabel10.getText();
        ans.setText(st);;
        }
        if(count>=8)
            check.setVisible(true);

    }                                     

    private void jLabel6MouseClicked(java.awt.event.MouseEvent evt) {                                     
        count++;
        if(count<=8){
        st=st+jLabel6.getText();
        ans.setText(st);;
        }
        if(count>=8)
            check.setVisible(true);

    }                                    

    private void jLabel3MouseClicked(java.awt.event.MouseEvent evt) {                                     
        count++;
        if(count<=8){
        st=st+jLabel3.getText();
        ans.setText(st);;
        }
        if(count>=8)
            check.setVisible(true);

    }                                    

    private void jLabel7MouseClicked(java.awt.event.MouseEvent evt) {                                     
        count++;
        if(count<=8){
        st=st+jLabel7.getText();
        ans.setText(st);;
        }
        if(count>=8)
            check.setVisible(true);

    }                                    

    private void jLabel9MouseClicked(java.awt.event.MouseEvent evt) {                                     
        count++;
        if(count<=8){
        st=st+jLabel9.getText();
        ans.setText(st);;
        }
        if(count>=8)
            check.setVisible(true);

    }                                    

    private void jLabel8MouseClicked(java.awt.event.MouseEvent evt) {                                     
        count++;
        if(count<=8){
        st=st+jLabel8.getText();
        ans.setText(st);;
        }
        if(count>=8)
            check.setVisible(true);

    }                                    

    private void checkActionPerformed(java.awt.event.ActionEvent evt) {                                      
        if(ans.getText().equalsIgnoreCase("Computer"))
            JOptionPane.showMessageDialog(this, "Yepii!!, You Won");
        else
            JOptionPane.showMessageDialog(this, "Wrong, Try Again");
                    
    }                                     

    private void resetActionPerformed(java.awt.event.ActionEvent evt) {                                      
        count =0;
        st ="";
        ans.setText("");
}                                     
    
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new ScrambleWords().setVisible(true);
            }
        });
    }

[Find More Java Codes at www.sumikuma.tk]

Comments

Popular posts from this blog

Binary Converter - Netbeans Java Codes

You can also download text file of this code here:   BinaryConverter.txt Java Code: public class BinaryConv { public static void main(String[] args) { Scanner in = new Scanner(System.in); int decimalNumber; String binaryNumber; System.out.print("Enter a positive integer: "); decimalNumber = in.nextInt(); if (decimalNumber <= 0) System.out.println("ERROR: entered integer is nonpositive."); else { binaryNumber = ""; // algorithm step by step // initial: binaryNumber = "", decimalNumber = 123 // step 1 : binaryNumber = "1 ", decimalNumber = 61 // step 2 : binaryNumber = "11 ", decimalNumber = 30 // step 3 : binaryNumber = "011 ", decimalNumber = 15 // step 4 : binaryNumber = "1011 ", decimalNumber = 7 // step 5 : binaryNumber = "1 1011 ", decimalNumber = 3 // step 6 : binaryNumber = "11 1011 ", decimalNumber = 1 // step 6 : binaryNumber = "111 1011 ",...

Tic Tac Toe - Netbeans Java Codes

Java Code: public class TicTacToe implements ActionListener { final String VERSION = "1.0"; //Setting up ALL the variables[Find More Java Codes at www.sumikuma.tk] JFrame window = new JFrame("Tic-Tac-Toe " + VERSION); JMenuBar mnuMain = new JMenuBar(); JMenuItem mnuNewGame = new JMenuItem("New Game"), mnuInstruction = new JMenuItem("Instructions"), mnuExit = new JMenuItem("Exit"), mnuAbout = new JMenuItem("About"); JButton btn1v1 = new JButton("Player vs Player"), btn1vCPU = new JButton("Player vs CPU"), btnBack = new JButton("<--back"); JButton btnEmpty[] = new JButton[10]; JPanel pnlNewGame = new JPanel(), pnlNorth = new JPanel(), pnlSouth = new JPanel(), pnlTop = new JPanel(), pnlBottom = new JPanel(), pnlPlayingField = new JPanel(); JLabel lblTitle = new JLabel("Tic-Tac-Toe"); JTextArea txtMessage = new JTextArea(); final int winCombo[][] = new int[][] { {1, 2, 3}, {...

ARJUN COOM's Kabhi-Kabhi [feat. Shivali & Natasha] Song Lyrics

MUSIC Written, produced and performed by Arjun Hindi chorus performed by Shivali and Natasha Originally written by Khayyam  Mixing - Elliot Bradley, Soho Studios ------------------------------------------------------------------------------------- Chorus: Kabhi Kabhi Mere Dil Mein Khayal ata Hai Kabhi Kabhi Mere Dil Mein Khayal Ata Hai I feel like a plane on a runaway about to lift off I feel like an ocean so deep, deep as my love You should know that it's you that I've chosen and I'm ready to give you my all Yes I'm right open Come and get, come and get it. You know that I could be. The one that makes you complete 'Cause I've fallen head over heels, and you're the only one. Chorus: Kabhi Kabhi Mere Dil Mein Khayal Aata Hai Kabhi Kabhi Mere Dil Mein Khayal Aata Hai Kii Jaise Tujhko Banaya Gyaa Hai Mere Liye Kii Jaise Tujhko Banaya Gyaa Hai Mere Liye I used to be lost in the darkness, but you were my star. I feel like a king when I'm in your arms, and ...