Crypto Chart

Language

A simple GUI that displays upto date data about Cryptocurrencies such as Bitcoin, IOTA, Ethereum and CarVertical. The program is written using NETBEANS IDE.
  1. private void JButton_Cryptocurrency_chart_EnterMouseClicked(java.awt.event.MouseEvent evt) {
  2. if (JComboBox_select_cryptocurrency.getSelectedIndex() == 0)
  3. {
  4. JOptionPane.showMessageDialog(null, "Please select a CryptoCurrency from the Combobox", "Error", JOptionPane.ERROR_MESSAGE);
  5. System.out.println("Please select a CryptoCurrency from the Combobox");
  6. }
  7. else if (JComboBox_select_cryptocurrency.getSelectedIndex() != 0)
  8. {
  9.  
  10. try
  11. {
  12. String Jcombobox_selected_crypto_value = JComboBox_select_cryptocurrency.getSelectedItem().toString();
  13. URL url_crypto = null;
  14.  
  15.  
  16. if (Jcombobox_selected_crypto_value == "Bitcoin (BTC)")
  17. {
  18. url_crypto = new URL("https://api.coinmarketcap.com/v1/ticker/bitcoin/");
  19. }
  20.  
  21. else if (Jcombobox_selected_crypto_value == "Ethereum (ETH)")
  22. {
  23. url_crypto = new URL("https://api.coinmarketcap.com/v1/ticker/ethereum/");
  24. }
  25.  
  26. else if (Jcombobox_selected_crypto_value == "Ripple (XRP)")
  27. {
  28. url_crypto = new URL("https://api.coinmarketcap.com/v1/ticker/ripple/");
  29. }
  30.  
  31. else if (Jcombobox_selected_crypto_value == "Cardano (ADA)")
  32. {
  33. url_crypto = new URL("https://api.coinmarketcap.com/v1/ticker/cardano/");
  34. }
  35.  
  36. else if (Jcombobox_selected_crypto_value == "Stellar (XLM)")
  37. {
  38. url_crypto = new URL("https://api.coinmarketcap.com/v1/ticker/stellar/");
  39. }
  40.  
  41. else if (Jcombobox_selected_crypto_value == "IOTA (MIOTA)")
  42. {
  43. url_crypto = new URL("https://api.coinmarketcap.com/v1/ticker/iota/");
  44. }
  45.  
  46. else if (Jcombobox_selected_crypto_value == "TRON (TRX)")
  47. {
  48. url_crypto = new URL("https://api.coinmarketcap.com/v1/ticker/tron/");
  49. }
  50.  
  51. else if (Jcombobox_selected_crypto_value == "VeChain (VEN)")
  52. {
  53. url_crypto = new URL("https://api.coinmarketcap.com/v1/ticker/vechain/");
  54. }
  55.  
  56. else if (Jcombobox_selected_crypto_value == "OmiseGO (OMG)")
  57. {
  58. url_crypto = new URL("https://api.coinmarketcap.com/v1/ticker/omisego/");
  59. }
  60.  
  61. else if (Jcombobox_selected_crypto_value == "Verge (XVG)")
  62. {
  63. url_crypto = new URL("https://api.coinmarketcap.com/v1/ticker/verge/");
  64. }
  65.  
  66. else if (Jcombobox_selected_crypto_value == "KuCoin Shares (KCS)")
  67. {
  68. url_crypto = new URL("https://api.coinmarketcap.com/v1/ticker/kucoin-shares/");
  69. }
  70.  
  71. else if (Jcombobox_selected_crypto_value == "UTRUST (UTK)")
  72. {
  73. url_crypto = new URL("https://api.coinmarketcap.com/v1/ticker/utrust/");
  74. }
  75.  
  76. else if (Jcombobox_selected_crypto_value == "Bread (BRD)")
  77. {
  78. url_crypto = new URL("https://api.coinmarketcap.com/v1/ticker/bread/");
  79. }
  80.  
  81. else if (Jcombobox_selected_crypto_value == "AppCoins (APPC)")
  82. {
  83. url_crypto = new URL("https://api.coinmarketcap.com/v1/ticker/appcoins/");
  84. }
  85.  
  86. else if (Jcombobox_selected_crypto_value == "Substratum (SUB)")
  87. {
  88. url_crypto = new URL("https://api.coinmarketcap.com/v1/ticker/substratum/");
  89. }
  90.  
  91. else if (Jcombobox_selected_crypto_value == "carVertical (CV)")
  92. {
  93. url_crypto = new URL("https://api.coinmarketcap.com/v1/ticker/carvertical/");
  94. }
  95.  
  96. //Continue with the execution
  97. String[] crypto_coins_array_data = new String[15];
  98. GetURLContent obj_url_content = new GetURLContent();
  99. crypto_coins_array_data = obj_url_content.GetURLContent(url_crypto);
  100.  
  101. JLabel_id_cryptocurrency.setVisible(true);
  102. JLabel_name_cryptocurrency.setVisible(true);
  103. JLabel_symbol_cryptocurrency.setVisible(true);
  104. JLabel_rank_cryptocurrency.setVisible(true);
  105. JLabel_price_usd_cryptocurrency.setVisible(true);
  106. JLabel_price_btc_cryptocurrency.setVisible(true);
  107. JLabel_24hr_volume_cryptocurrency.setVisible(true);
  108. JLabel_market_cap_usd_cryptocurrency.setVisible(true);
  109. JLabel_available_supply_cryptocurrency.setVisible(true);
  110. JLabel_total_supply_cryptocurrency.setVisible(true);
  111. JLabel_max_supply_cryptocurrency.setVisible(true);
  112. JLabel_percentage_change_1hr_cryptocurrency.setVisible(true);
  113. JLabel_percentage_change_24hr_cryptocurrency.setVisible(true);
  114. JLabel_percentage_change_7d_cryptocurrency.setVisible(true);
  115. JLabel_last_updated_cryptocurrency.setVisible(true);
  116.  
  117. JLabel_id_of_cryptocurrency_value.setVisible(true);
  118. JLabel_name_cryptocurrency_value.setVisible(true);
  119. JLabel_symbol_cryptocurrency_value.setVisible(true);
  120. JLabel_rank_cryptocurrency_value.setVisible(true);
  121. JLabel_price_usd_cryptocurrency_value.setVisible(true);
  122. JLabel_price_btc_cryptocurrency_value.setVisible(true);
  123. JLabel_24hr_volume_cryptocurrency_value.setVisible(true);
  124. JLabel_market_cap_usd_cryptocurrency_value.setVisible(true);
  125. JLabel_available_supply_cryptocurrency_value.setVisible(true);
  126. JLabel_total_supply_cryptocurrency_value.setVisible(true);
  127. JLabel_max_supply_cryptocurrency_value.setVisible(true);
  128. JLabel_percentage_change_1hr_cryptocurrency_value.setVisible(true);
  129. JLabel_percentage_change_24hr_cryptocurrency_value.setVisible(true);
  130. JLabel_percentage_change_7d_cryptocurrency_value.setVisible(true);
  131. JLabel_last_updated_cryptocurrency_value.setVisible(true);
  132.  
  133. int I_counter;
  134. for (I_counter = 0; I_counter<15; I_counter++)
  135. {
  136. if (crypto_coins_array_data[I_counter] == null || crypto_coins_array_data[I_counter].trim().length() == 0)
  137. {
  138. crypto_coins_array_data[I_counter] = "___";
  139. }
  140. }
  141.  
  142. for (int k_counter = 11; k_counter<14; k_counter++)
  143. { String text_color;
  144.  
  145. if (crypto_coins_array_data[k_counter]== null || crypto_coins_array_data[k_counter]=="___")
  146. {
  147. crypto_coins_array_data[k_counter] = "<html><font color='orange'>___</font></html>";
  148. }
  149.  
  150. else
  151. {
  152. double d = Double.parseDouble(crypto_coins_array_data[k_counter]);
  153. if (d < 1)
  154. {
  155. crypto_coins_array_data[k_counter] = "<html><font color='green'>" + d + "</font></html>";
  156. }
  157. else
  158. {
  159. crypto_coins_array_data[k_counter] = "<html><font color='red'>" + d + "</font></html>";
  160. }
  161. }
  162. }
  163.  
  164. JLabel_id_of_cryptocurrency_value.setText(crypto_coins_array_data[0]);
  165. JLabel_name_cryptocurrency_value.setText(crypto_coins_array_data[1]);
  166. JLabel_symbol_cryptocurrency_value.setText(crypto_coins_array_data[2]);
  167. JLabel_rank_cryptocurrency_value.setText(crypto_coins_array_data[3]);
  168. JLabel_price_usd_cryptocurrency_value.setText(crypto_coins_array_data[4]);
  169. JLabel_price_btc_cryptocurrency_value.setText(crypto_coins_array_data[5]);
  170. JLabel_24hr_volume_cryptocurrency_value.setText(crypto_coins_array_data[6]);
  171. JLabel_market_cap_usd_cryptocurrency_value.setText(crypto_coins_array_data[7]);
  172. JLabel_available_supply_cryptocurrency_value.setText(crypto_coins_array_data[8]);
  173. JLabel_total_supply_cryptocurrency_value.setText(crypto_coins_array_data[9]);
  174. JLabel_max_supply_cryptocurrency_value.setText(crypto_coins_array_data[10]);
  175. JLabel_percentage_change_1hr_cryptocurrency_value.setText(crypto_coins_array_data[11]);
  176. JLabel_percentage_change_24hr_cryptocurrency_value.setText(crypto_coins_array_data[12]);
  177. JLabel_percentage_change_7d_cryptocurrency_value.setText(crypto_coins_array_data[13]);
  178. JLabel_last_updated_cryptocurrency_value.setText(crypto_coins_array_data[14]);

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. After downloading it, you will need a program like Winzip to decompress it.

Virus note: All files are scanned once-a-day by SourceCodester.com for viruses, but new viruses come out every day, so no prevention program can catch 100% of them.

FOR YOUR OWN SAFETY, PLEASE:

1. Re-scan downloaded files using your personal virus checker before using it.
2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.

Comments

Submitted byMukama Kalibala (not verified)on Fri, 02/09/2018 - 16:30

You posted any important post bro, but you didn't share your contacts info. How can I get you?
Submitted byHarold Burton (not verified)on Wed, 06/09/2021 - 01:12

This article fails to mention key information such as the fact that some of these wallets don’t support the forks. That, besides security, is arguably the most important information. Harold Burton
Submitted byAshley Jones (not verified)on Wed, 06/16/2021 - 18:15

You are putting out some GREAT videos that are very informative to a newb, like me, in the cryptocurrency market. I just began investing in cryptocurrencies a week or so ago. I currently don’t have a large sum of money in the market and have all my coins in exchanges for the time being while I figure out what type of wallet best suits me. My thought is that a paper wallet will be my choice based on the fact that I am planning to hold on to my coins for some time. I do however like the idea of a desktop wallet for ease of use and the portfolio option but I can also use a portfolio app. I also have a handful of altcoins like ada and xrp that don’t appear to have any desktop wallet options. If i go the paper wallet route, is there a transaction fee every time I transfer back to hot wallet? Also once a paper wallet is established, is it just a matter of sending purchased cryptocurrency to the established public key to transfer the coins there? Can I create paper wallets for these altcoins? Thanks again in advance for your reply and I’ll continue to educate myself with your videos and content. Ashley Jones
Submitted byJoseph Donahue (not verified)on Fri, 07/02/2021 - 23:28

If a site goes evil or disappears, since your using their software, tech, wallet etc. How are you to recover your cryptocoin? Which tech systems will protect from this scenerio so you can use others if your chosen tech goes bye. Joseph Donahue
Submitted byKelly Hubbard (not verified)on Sat, 09/04/2021 - 11:52

Hi, Thank you for the Review. I’m a newbie when it comes to cryptocurrency and your website really helped me alot. I want to invest on some top altcoins, as of now I have LTC, Dash,Doge, XPR and BTC. Based on your review above, I think I can use exodus as my wallet but i just have a quick question. It’s alright to uninstall and reinstall it to a different computer/laptop right? and can it be downloaded and open simultaneously to two different computers? I’m sorry , i’m really noob. Kelly Hubbard
Submitted byAshley Jones (not verified)on Thu, 09/16/2021 - 07:59

Your Bitcoin wallets review was so helpful. I have read a certain comments and you say that Exchange-Wallet web service it is not good idea, because all risks it can have. In that way, what do you think about SpectroCoin services. CrazyAsk

Add new comment