this small java application is helpful for cryptocurrency

in #cryptocurancy8 years ago

if you are working on cryptocurrency  world. you need some tools.

1. computer

2. Internet connection

3. fucking brain

4. big eyes


and i am going to introduce i am create some tools for cryptocurency. this tools is big help for me.

if you are a programer this idea for you. ( Cryptocurrency + Programing) = ???

this is source code.



import java.applet.Applet;

import java.applet.AudioClip;

import java.awt.Toolkit;

import java.awt.event.ActionEvent;

import java.awt.event.ActionListener;

import java.io.File;

import java.io.IOException;

import java.net.URL;

import java.text.SimpleDateFormat;

import java.util.Date;

import java.util.Timer;

import java.util.TimerTask;

import java.util.logging.Level;

import java.util.logging.Logger;

import javax.swing.ImageIcon;

import javax.swing.JOptionPane;

import org.jsoup.Jsoup;

import org.jsoup.nodes.Document;

import org.jsoup.nodes.Element;

import org.jsoup.select.Elements;


/*

 * To change this license header, choose License Headers in Project Properties.

 * To change this template file, choose Tools | Templates

 * and open the template in the editor.

 */

/**

 *

 * @author sandun

 */

public class NewJFrame1 extends javax.swing.JFrame {


    /**

     * Creates new form NewJFrame1

     */

    public NewJFrame1() {

        initComponents();

        loada();


    }


    /**

     * This method is called from within the constructor to initialize the form.

     * WARNING: Do NOT modify this code. The content of this method is always

     * regenerated by the Form Editor.

     */

    @SuppressWarnings("unchecked")

    // <editor-fold defaultstate="collapsed" desc="Generated Code">                          

    private void initComponents() {


        jPanel1 = new javax.swing.JPanel();

        ta = new javax.swing.JTextField();

        jLabel4 = new javax.swing.JLabel();

        a = new javax.swing.JTextField();

        jLabel2 = new javax.swing.JLabel();

        jButton1 = new javax.swing.JButton();

        jButton2 = new javax.swing.JButton();

        jLabel3 = new javax.swing.JLabel();

        jButton3 = new javax.swing.JButton();

        jMenuBar1 = new javax.swing.JMenuBar();

        jMenu1 = new javax.swing.JMenu();

        jMenu2 = new javax.swing.JMenu();


        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        setState(5);

        getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());


        jPanel1.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());


        ta.setFont(new java.awt.Font("Tahoma", 1, 24)); // NOI18N

        ta.setEnabled(false);

        jPanel1.add(ta, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 120, 220, 50));


        jLabel4.addMouseListener(new java.awt.event.MouseAdapter() {

            public void mouseClicked(java.awt.event.MouseEvent evt) {

                jLabel4MouseClicked(evt);

            }

        });

        jPanel1.add(jLabel4, new org.netbeans.lib.awtextra.AbsoluteConstraints(240, 0, 30, 20));


        a.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N

        jPanel1.add(a, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 220, 220, 30));


        jLabel2.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N

        jLabel2.setText("DigiByte (DGB) Market");

        jPanel1.add(jLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 80, 250, 30));


        jButton1.setText("Edit");

        jButton1.addActionListener(new java.awt.event.ActionListener() {

            public void actionPerformed(java.awt.event.ActionEvent evt) {

                jButton1ActionPerformed(evt);

            }

        });

        jPanel1.add(jButton1, new org.netbeans.lib.awtextra.AbsoluteConstraints(120, 260, 110, 40));


        jButton2.setText("Submit");

        jButton2.addActionListener(new java.awt.event.ActionListener() {

            public void actionPerformed(java.awt.event.ActionEvent evt) {

                jButton2ActionPerformed(evt);

            }

        });

        jPanel1.add(jButton2, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 260, 100, 40));


        jLabel3.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N

        jLabel3.setText("Your value");

        jPanel1.add(jLabel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 180, 120, 40));


        jButton3.setText("Start market");

        jButton3.addActionListener(new java.awt.event.ActionListener() {

            public void actionPerformed(java.awt.event.ActionEvent evt) {

                jButton3ActionPerformed(evt);

            }

        });

        jPanel1.add(jButton3, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 40, 220, 30));


        getContentPane().add(jPanel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 270, 320));


        jMenu1.setText("About");

        jMenu1.addMouseListener(new java.awt.event.MouseAdapter() {

            public void mouseClicked(java.awt.event.MouseEvent evt) {

                jMenu1MouseClicked(evt);

            }

        });

        jMenu1.addActionListener(new java.awt.event.ActionListener() {

            public void actionPerformed(java.awt.event.ActionEvent evt) {

                jMenu1ActionPerformed(evt);

            }

        });

        jMenuBar1.add(jMenu1);

        jMenuBar1.add(jMenu2);


        setJMenuBar(jMenuBar1);


        pack();

    }// </editor-fold>                        


    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {                                         

        // TODO add your handling code here:

        a.disable();

    }                                        


    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {                                         

        // TODO add your handling code here:

        a.enable();

    }                                        


    private void jLabel4MouseClicked(java.awt.event.MouseEvent evt) {                                     

        // TODO add your handling code here:

        System.exit(0);

    }                                    


    private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {                                         

        // TODO add your handling code here:

        javax.swing.Timer t;

        t = new javax.swing.Timer(1000, new ActionListener() {

            @Override

            public void actionPerformed(ActionEvent e) {


                Document doc;

                try {


                    String y=a.getText();

                   

                    // need http protocol

                    doc = Jsoup.connect("https://coinmarketcap.com/currencies/digibyte/").get();


                    Elements divTag = doc.getElementsByClass("text-gray");


                    System.out.println(divTag.text());


                    String x = divTag.text().toString();

                    String fi = "";

                    for (int i = 0; i < 11; i++) {


                        char c = x.charAt(i);

                        fi = fi + c;

                    }

                    System.out.println(fi);


                    ta.setText(fi);

                    

                    

                    String x1=a.getText();

                    String x2=ta.getText();

                    

                    if (false) {

                        System.out.println("yes");

                        Toolkit.getDefaultToolkit().beep();

                        

                    }


                } catch (java.net.UnknownHostException rt) {


                   

                    JOptionPane.showMessageDialog(createRootPane(),"not a internet connection");

                     System.exit(0);

                } catch (IOException d) {

                }


            }

        });

        t.start();



    }                                        


    private void jMenu1ActionPerformed(java.awt.event.ActionEvent evt) {                                       

        // TODO add your handling code here:

        

       

    }                                      


    private void jMenu1MouseClicked(java.awt.event.MouseEvent evt) {                                    

        // TODO add your handling code here:

         JOptionPane.showMessageDialog(this," sandun chathuranga");

    }                                   


    /**

     * @param args the command line arguments

     */

    public static void main(String args[]) {

        /* Set the Nimbus look and feel */

        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">

        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.

         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 

         */

        try {

            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {

                if ("Nimbus".equals(info.getName())) {

                    javax.swing.UIManager.setLookAndFeel(info.getClassName());

                    break;

                }

            }

        } catch (ClassNotFoundException ex) {

            java.util.logging.Logger.getLogger(NewJFrame1.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);

        } catch (InstantiationException ex) {

            java.util.logging.Logger.getLogger(NewJFrame1.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);

        } catch (IllegalAccessException ex) {

            java.util.logging.Logger.getLogger(NewJFrame1.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);

        } catch (javax.swing.UnsupportedLookAndFeelException ex) {

            java.util.logging.Logger.getLogger(NewJFrame1.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);

        }

        //</editor-fold>


        /* Create and display the form */

        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {

                new NewJFrame1().setVisible(true);

                System.out.println("hello");

            }

        });

    }


    // Variables declaration - do not modify                     

    private javax.swing.JTextField a;

    private javax.swing.JButton jButton1;

    private javax.swing.JButton jButton2;

    private javax.swing.JButton jButton3;

    private javax.swing.JLabel jLabel2;

    private javax.swing.JLabel jLabel3;

    private javax.swing.JLabel jLabel4;

    private javax.swing.JMenu jMenu1;

    private javax.swing.JMenu jMenu2;

    private javax.swing.JMenuBar jMenuBar1;

    private javax.swing.JPanel jPanel1;

    private javax.swing.JTextField ta;

    // End of variables declaration                   


    private void loadtext() {


        try {

            Thread.sleep(1000);

        } catch (InterruptedException ex) {

            Logger.getLogger(NewJFrame1.class.getName()).log(Level.SEVERE, null, ex);

        }


        Document doc;

        try {


            // need http protocol

            doc = Jsoup.connect("https://coinmarketcap.com/currencies/digibyte/").get();


            Elements divTag = doc.getElementsByClass("text-gray");


            System.out.println(divTag.text());


            String x = divTag.text().toString();

            String fi = "";

            for (int i = 0; i < 11; i++) {


                char c = x.charAt(i);

                fi = fi + c;

            }

            System.out.println(fi);


            ta.setText(fi);


        } catch (java.net.UnknownHostException e) {

            JOptionPane.showMessageDialog(this, " No Internet");

            System.exit(0);

        } catch (IOException d) {

        }


    }


    private void loada() {


        Timer t = new Timer();

        TimerTask tt = new TimerTask() {

            @Override

            public void run() {


                System.out.println("x");

            }

        };

    }

}


Sort:  

well its not small ha ?

ohh Thanks buddy

What does this app do?

Don't forget thick skin lol