Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / February 2007

Tip: Looking for answers? Try searching our database.

Parsing or Casting a JtextField? Help requested....

Thread view: 
Tamer Higazi - 28 Feb 2007 05:20 GMT
Hi!
I have a JTextField which receives at runtime a value. Now this value
has to be inserted with a specialtype (not text) in a database.

In the java chat somebody told me that I have to parse. I know only on
C++ that the conversion a value from one datatype to one other has to be
casted.

Can somebody give me a sample?

I would thank very much for any help coming from your side

kind regards

Tamer Higazi
Andrew Thompson - 28 Feb 2007 07:16 GMT
..
> I have a JTextField which receives at runtime a value. Now this value
> has to be inserted with a specialtype (not text) in a database.

Like special how?  (Do not tell us what
it is not, tell us what it is.)

Andrew T.
Tamer Higazi - 28 Feb 2007 15:36 GMT
From the runtime the values in a JTextField have to be assigned to
variables with the following datatype:

short
byte
int

I don't know how to do that!

For any help

Thank you

Tamer

Andrew Thompson schrieb:
> ..
>> I have a JTextField which receives at runtime a value. Now this value
[quoted text clipped - 4 lines]
>
> Andrew T.
Patricia Shanahan - 28 Feb 2007 16:02 GMT
> From the runtime the values in a JTextField have to be assigned to
> variables with the following datatype:
[quoted text clipped - 4 lines]
>
> I don't know how to do that!

Short.parseShort(String s)
Byte.parseByte(String s)
Integer.parseInt(String s)

More generally, if you need to do something with e.g. an int and don't
know how to do it, it is always worth scanning the methods in Integer to
see if one helps.

Patricia


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.