You should check out the Yahoo APIs.
http://developer.yah...everything.html
Also, I want to expand on a couple of points made. First, the switch block in Fuzzyness' code sample is legal only if you are using Java 7. Previous versions do not support switch blocks for Strings. Second, for the non-special keys (enter, shift, caps-lock, etc.), you can handle them all with one general algorithm: get the JButton's text and append it to the JTextArea (with your only concern being casing for letters).
24 Replies - 1022 Views - Last Post: 25 February 2012 - 10:39 PM
#17
Re: GUI Keyboard Simulator
Posted 23 February 2012 - 07:38 PM
Hello guys, I reckoned the switch block problem as well but I managed to use a more basic way to do it.
Apologise that's quite a lot to ask, but very unfortunately I do not have a few weeks to practise it over....
I wouldn't have turned to you guys if it isn't that desperate.
Maybe you can just point me to the right direction, like any tutorials online or stuff of similar sort so I can have a look at it, prolly I can get some codes
done and come to you guys when I have developed something? Instead of asking you guys to build sth from scratch ??
Anything helpful will be much appreciated (:
Cheers!
Apologise that's quite a lot to ask, but very unfortunately I do not have a few weeks to practise it over....
I wouldn't have turned to you guys if it isn't that desperate.
Maybe you can just point me to the right direction, like any tutorials online or stuff of similar sort so I can have a look at it, prolly I can get some codes
done and come to you guys when I have developed something? Instead of asking you guys to build sth from scratch ??
Anything helpful will be much appreciated (:
Cheers!
#18
Re: GUI Keyboard Simulator
Posted 23 February 2012 - 07:41 PM
We have a bunch of tutorials on DIC you can take advantage of.
#19
Re: GUI Keyboard Simulator
Posted 24 February 2012 - 02:59 PM
Hello there, I have some codes here which I can get data from the Yahoo Finance Service.
However, it returned a statement like Missing Symbol Lists.
Anyone can help me where my code goes wrong?
Thanks!
However, it returned a statement like Missing Symbol Lists.
Anyone can help me where my code goes wrong?
Thanks!
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Scanner;
public class StockInfo
{
public String StockInfo(String yahooFIn)
{
StringBuilder buf = new StringBuilder();
Scanner in = null;
try {
URL yahooFin = new URL("http://finance.yahoo.com/d/quotes.csv?s=");
in = new Scanner(yahooFin.openStream());
while (in.hasNextLine()) {
buf.append(in.nextLine() + "\n");
}
return buf.toString();
} catch (MalformedURLException e) {
System.err.println(e);
} catch (IOException e) {
System.err.println(e);
} finally {
if (in != null)
{
in.close();
}
}
return null;
}
}
#20
Re: GUI Keyboard Simulator
Posted 24 February 2012 - 08:39 PM
What is the use of String yahooFIn that you pass as parameter to your method ?
#21
Re: GUI Keyboard Simulator
Posted 24 February 2012 - 08:43 PM
That was intended to be the stock symbol that the user typed in. (?)
#22
Re: GUI Keyboard Simulator
Posted 24 February 2012 - 08:50 PM
so where do you pass it to the Yahoo API ?
#23
Re: GUI Keyboard Simulator
Posted 25 February 2012 - 07:42 AM
OH!!!!!
I got it!
Is this the way I should put it?
but what I get is the info displayed in one line
can I get them to display on the next line for each info??
Thanks!!!
I got it!
Is this the way I should put it?
try {
URL yahooFin = new URL("http://finance.yahoo.com/d/quotes.csv?s=" +symbol + "&f=snl1pdj1xe1");
URLConnection con = yahooFin.openConnection();
but what I get is the info displayed in one line
can I get them to display on the next line for each info??
Thanks!!!
#24
Re: GUI Keyboard Simulator
Posted 25 February 2012 - 02:11 PM
Where do you display something ?
#25
Re: GUI Keyboard Simulator
Posted 25 February 2012 - 10:39 PM
Back in the codes I posted before, there are two jlabels input and output
I was trying to display it next to the output jlabel.
Cheers
I was trying to display it next to the output jlabel.
Cheers
|
|

New Topic/Question
Reply







MultiQuote


|