Here goes a simple JAVA code to convert rupees by using the online yahoo exchange rates. package com.oksbwn.currencyRate; import java.io.IOException; import javax.swing.JOptionPane; import org.apache.http.client.HttpClient; import org.apache.http.client.ResponseHandler; import org.apache.http.client.methods.HttpGet; import org.apache.http.impl.client.*; import com.oksbwn.popUp.popMe; public class YahooCurrencyConverter { @SuppressWarnings({ “deprecation”, “resource” }) public float convert(String currencyFrom, String currencyTo) throws IOException { HttpClient httpclient = new DefaultHttpClient(); HttpGet httpGet = new HttpGet(“http://quote.yahoo.com/d/quotes.csv?s=” + currencyFrom + currencyTo + “=X&f=l1&e=.csv”); ResponseHandler responseHandler = new BasicResponseHandler(); String responseBody = httpclient.execute(httpGet, responseHandler); httpclient.getConnectionManager().shutdown(); return Float.parseFloat(responseBody); } public void convertToRs() { String to = null; String amnt =…
Read MoreMonth: December 2017
A Transparent screen to lock the Desktop.
In this code i am sharing the code to lock the PC screen by using a transparent JFrame so as to restrict others to use it.The frame disappears only when the user enters the right username and password.This enables the user to let the background tasks going on and lock the screen.This has the only problem that it can be closed by the task manager.If you find a solution to it please let me know. package com.oksbwn.systeminteraction; import java.awt.Color; import java.awt.Dimension; import java.awt.Toolkit; import java.awt.event.KeyAdapter; import java.awt.event.KeyEvent; import java.awt.event.MouseAdapter; import…
Read More