Java Netbeans - Currency Converter Part 2 of 3

Java Netbeans - Currency Converter Part 2 of 3


This tutorial will show you how to create a currency converter the easy way. It covers downloading website contents (from XE) and using regular expression to match the rates.
Link to text file containing the regular expression, link & currency list:
http://azizsaleh.com/text/java-currency-converter.txt
Source Code:
http://www.azizsaleh.com/text/java-currency-converter-source.txt
Closed Caption:

fareal I already have its you could just
even go to their website and
you can find that out its care finance
that yahoo dot com cue
piece he straying from
and then here is where we actually have
the kar
from code and then
we do D kar to code
that's how it is there for some reason
that's how you who does that
like one string together so
and equal capital ex
and T
he for fry and
the and
no Tim Kirby in this from your home's
equal
on and the
equal me just copy the URL is much
easier
too many this is it
be boasting disco
online say could excision Scott beard of
now will
do a try parks pics it basically will
try to
get the information from the Yahoo
straying results canteen
now the you are no
the page
equal new URL
New York are to
the URL though we have from though he
created on time Jersey means
Kings so we got the string URL
the URL peas let's sir
though the per Farid
basically we have the
the page as the input stream
we the new InputStream on it
and the new Prof read and restore it
in and it's basically the perforator
though we have
the we have the strain for the
input line this is basically for each
line that's
though we can read while the import
line takes it from the in redline
in and it's not no the
results will be results
that and put my this basically late like
a while will be if you have read the
knee while in beach P
this is almost the same thing we have
all these areas here let's just go on
include all the files are we actually
need the
had the first of all we need is the URL
the one which is dead
so the all Java related so the religious
job for that
net that URL and as you type it to
actually sit or complete
now we also need the pasta read gonna be
Java and it's in
I know that puffery
yeah for for reader and then we have the
at we need the InputStream to implored
Java that I you know that InputStream
reader we nuclear we got the
URL we have the for reader the campus
reader
let's also import the swing
class for the Java we need that for the
parks and stuff
now we also need to
import to basically those two are
basically for the
regular expression we can use to get the
information
there a Java utilities and the
ConvergEx the first one is the matcher
the other one will be the
pattern get a turn
there well
should be there technically speaking you
see this
yeah I guess this you don't need this
here
GX 10
you know small correct as a kissy
I don't know why it's giving me invalid
package
but I'm assuming that
probably you just have to do it under
the package
yeah seeing
probably something with the here so
now that we have everything here cannot
find
the option pain J
option yep this is a
see what it included
year was the this is the one you're
missing the Egyptian pain
so we have this here we have everything
the new to soldiers go back here in
we have the resort's
and then we just close the upper for
reader now
here we could do all the stuff but
before we do the stuff assist dewey
catch
basically let's catch any errors
if the if they have been
basically
the system requires have cash flow you
really don't need any cats
me it's not like we can be done but you
could also
do any error handling here if you do on
till
that's basically you know basically yet
okay we have deeper for reader
caper for reader
new are InputStream
p dot open stream:
know that these cannot find the page
so my can find a peaceful
the pages here celebrities
this problem sometimes have a brick a
sometimes you have to lower case
so that these new URL URL
see its cannot find symbol who
InputStream
reader it's correct open streams
correct Prof word
well perforated
mines de its preferred reader new
proferred reader
prefer so we have it here now
let's a press here do
or handling
maybe let's just I guess do a box the
same way we had here
just say
unable to connect
to
Yahoo finance okay now let's
process all the information that we
gonna results has all the
database information is that the pattern
matching
the
let's have the that turn final pattern
we gonna do a new pattern and we gonna
compiler
and we can actually look for this
string this is iffy you the source
love the of the Yahoo results
this is basically it's an X moon
X this me here this is
where the but we have to escape
the double quote and here's the match
the the actual text that's going to be
there so
let's were only taken number so it's
going to be
029 and could be more than one number
and you also it might be the small so we
have the
died as well so this is gonna match the
pattern so now matcher let's do the
actual
mad que me TC
our match her match find
time no turn
and then we gonna do match her we gonna
try to match the
results
and then def hi me know pattern
you match it by the match find know we
had the match find
we have to execute the regular
expressions was gonna be
%um defiant now we gonna display the
current seeing
in a double loses to a double
the curry this is gonna be the current
rate of the exchange
and it's gonna be typecast double
value love
okay
and then we can actually do get the
thing from the
match find here
so basically my match fine it's gonna be
in the first group
K me and them double value
now we have the current rate
that's to the actual conversion
mean this is the rape like the rate
convert but we actually
get the number of the this one we just
marked by to get the actual total weight
she's going to be the total converts
it's gonna be the curry
multiply it by the double the value of
it's going to be kar amount that get
text
double
value know we have the total convert we
have this one
and now we need to a
get text now we have we actually have
the
value the conversion everything the
we need to get the current return
time trade time
matching basically discover the same
thing here
so but the we can match different stuff
and we can we declare it again because
we already have it
resist it's going to be. match the
basically span ID
me
span okay
now reenact take anything here
but the span ID if you would look at the
source code
its gonna have the it's gonna be if this
type
why FS underscore t10
underscore and it could be any number of
letters
equal X so
that's the actual patterned
we need to get
now we have this thats to
the display result displayed at set
text and then
me said the turks
but here's the thing: we have to format
it straightened out
format as a it's gonna be
I guess the some to the second places

Video Length: 13:59
Uploaded By: Aziz Saleh
View Count: 5,090

Related Software Products
Easy Currency Converter
Easy Currency Converter

Published By:
Ashkon Technology LLC

Description:
Easy Currency Converter is a simple currency calculator. It converts about 200 world currencies including Euro and updates exchange rates with a single button click. Cross- currency calculations are based on US Dollar local currency exchange rate.


Related Videos
Currency Converter 3.0.0 for Android
Currency Converter 3.0.0 for Android

Video Length: 01:13
Uploaded By: Rudo Halmi (1/5/2015)
View Count: 73,719

Visual Studio, Visual Basic - Currency Converter Part 1 of 2
Visual Studio, Visual Basic - Currency Converter Part 1 of 2

Video Length: 14:12
Uploaded By: Aziz Saleh (11/25/2010)
View Count: 51,989

Java Netbeans - Currency Converter Part 1 of 3
Java Netbeans - Currency Converter Part 1 of 3

Video Length: 14:45
Uploaded By: Aziz Saleh (11/25/2010)
View Count: 18,285

Android App: Easy Global Currency Converter (Money Exchange)
Android App: Easy Global Currency Converter (Money Exchange)

Video Length: 01:11
Uploaded By: Gao Shiyu (1/18/2013)
View Count: 17,700

Visual Studio, Visual Basic - Currency Converter Part 2 of 2
Visual Studio, Visual Basic - Currency Converter Part 2 of 2

Video Length: 06:55
Uploaded By: Aziz Saleh
View Count: 11,118

How to convert currency using Google
How to convert currency using Google

Video Length: 01:50
Uploaded By: butterscotchcom
View Count: 8,730

Best Currency Converter
Best Currency Converter

Video Length: 03:38
Uploaded By: ForexConspiracy (5/25/2011)
View Count: 6,844

Visual Studio 2012 Project How to Create Currency Converter in CSharp
Visual Studio 2012 Project How to Create Currency Converter in CSharp

Video Length: 19:21
Uploaded By: C# Software GUI (1/1/2016)
View Count: 5,990

Free and easy to use iPhone currency exchange converter App.
Free and easy to use iPhone currency exchange converter App.

Video Length: 02:57
Uploaded By: sergiopa2002 (11/24/2013)
View Count: 4,282

Java Netbeans - Currency Converter Part 3 of 3
Java Netbeans - Currency Converter Part 3 of 3

Video Length: 05:06
Uploaded By: Aziz Saleh
View Count: 4,079

Copyright © 2026, Ivertech. All rights reserved.