Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.gui > #1055 > unrolled thread

Parsing or Casting a Jtex

Started by"Tamer Higazi" <tamer.higazi@THRWHITE.remove-dii-this>
First post2011-04-27 15:31 +0000
Last post2011-04-27 15:31 +0000
Articles 7 — 4 participants

Back to article view | Back to comp.lang.java.gui


Contents

  Parsing or Casting a Jtex "Tamer Higazi" <tamer.higazi@THRWHITE.remove-dii-this> - 2011-04-27 15:31 +0000
    Re: Parsing or Casting a "Badshah" <badshah@THRWHITE.remove-dii-this> - 2011-04-27 15:31 +0000
    Re: Parsing or Casting a "Andrew Thompson" <andrew.thompson@THRWHITE.remove-dii-this> - 2011-04-27 15:31 +0000
    Re: Parsing or Casting a "Eric Smith" <eric.smith@THRWHITE.remove-dii-this> - 2011-04-27 15:31 +0000
      Re: Parsing or Casting a "Tamer Higazi" <tamer.higazi@THRWHITE.remove-dii-this> - 2011-04-27 15:31 +0000
        Re: Parsing or Casting a "Andrew Thompson" <andrew.thompson@THRWHITE.remove-dii-this> - 2011-04-27 15:31 +0000
        Re: Parsing or Casting a "Eric Smith" <eric.smith@THRWHITE.remove-dii-this> - 2011-04-27 15:31 +0000

#1055 — Parsing or Casting a Jtex

From"Tamer Higazi" <tamer.higazi@THRWHITE.remove-dii-this>
Date2011-04-27 15:31 +0000
SubjectParsing or Casting a Jtex
Message-ID<45e5129d$0$20296$9b4e6d93@newsspool3.arcor-online.net>
  To: comp.lang.java.gui
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

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

[toc] | [next] | [standalone]


#1056 — Re: Parsing or Casting a

From"Badshah" <badshah@THRWHITE.remove-dii-this>
Date2011-04-27 15:31 +0000
SubjectRe: Parsing or Casting a
Message-ID<1172647279.565419.141720@8g2000cwh.googlegroups.com>
In reply to#1055
  To: comp.lang.java.gui
Hi Tamer,

Can you explain your problem in detail ?

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

[toc] | [prev] | [next] | [standalone]


#1057 — Re: Parsing or Casting a

From"Andrew Thompson" <andrew.thompson@THRWHITE.remove-dii-this>
Date2011-04-27 15:31 +0000
SubjectRe: Parsing or Casting a
Message-ID<1172647769.395283.212050@m58g2000cwm.googlegroups.com>
In reply to#1055
  To: comp.lang.java.gui,comp.l
On Feb 28, 4:26 pm, Tamer Higazi <n...@mail.de> wrote:
> Hi!

Please cross-post, rather than multi-post.

(X-post to c.l.j.g./p., w/ f-u to c.l.j.g. only)

Andrew T.

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

[toc] | [prev] | [next] | [standalone]


#1058 — Re: Parsing or Casting a

From"Eric Smith" <eric.smith@THRWHITE.remove-dii-this>
Date2011-04-27 15:31 +0000
SubjectRe: Parsing or Casting a
Message-ID<qh4pp6eneq.fsf@ruckus.brouhaha.com>
In reply to#1055
  To: comp.lang.java.gui
Tamer Higazi <no@mail.de> writes:
> 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.

What kind of value?  A numeric value?  A string?  Parsed how?

You get the String value from the JTextField by using the getText() method.

If you want to treat it as an integer, you can pass that String to
Integer.parseInt() or Integer.valueOf().  Those will throw a
NumberFormatException if the String can't be parsed as an integer.
There are similar methods Long.parseLong(), Long.valueOf(),
Short.parseShort(), Short.valueOf(), Float.valueOf(), and
Double.valueOf().

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

[toc] | [prev] | [next] | [standalone]


#1062 — Re: Parsing or Casting a

From"Tamer Higazi" <tamer.higazi@THRWHITE.remove-dii-this>
Date2011-04-27 15:31 +0000
SubjectRe: Parsing or Casting a
Message-ID<45e5a0fa$0$23137$9b4e6d93@newsspool1.arcor-online.net>
In reply to#1058
  To: comp.lang.java.gui
From the runtime the values in a JTextField have to be assigned to a
variable with the following datatype:

short
byte
int

I don't know how to do that!

For any help

Thank you

Tamer

Eric Smith schrieb:
> Tamer Higazi <no@mail.de> writes:
>> 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.
> 
> What kind of value?  A numeric value?  A string?  Parsed how?
> 
> You get the String value from the JTextField by using the getText() method.
> 
> If you want to treat it as an integer, you can pass that String to
> Integer.parseInt() or Integer.valueOf().  Those will throw a
> NumberFormatException if the String can't be parsed as an integer.
> There are similar methods Long.parseLong(), Long.valueOf(),
> Short.parseShort(), Short.valueOf(), Float.valueOf(), and
> Double.valueOf().

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

[toc] | [prev] | [next] | [standalone]


#1070 — Re: Parsing or Casting a

From"Andrew Thompson" <andrew.thompson@THRWHITE.remove-dii-this>
Date2011-04-27 15:31 +0000
SubjectRe: Parsing or Casting a
Message-ID<1172719894.475655.184430@z35g2000cwz.googlegroups.com>
In reply to#1062
  To: comp.lang.java.gui
On Mar 1, 2:34 am, Tamer Higazi <n...@mail.de> wrote:
> From the runtime the values in a JTextField have to be assigned to a
> variable with the following datatype:

Do you intend adding replies to each of the
multi-posts you made, or are you intending to
continue treating these groups as if they were
your personal help-desk?

> short
> byte
> int
>
> I don't know how to do that!

I do!  But I do not intend posting the answer
on to each of your threads.

Andrew T.

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

[toc] | [prev] | [next] | [standalone]


#1071 — Re: Parsing or Casting a

From"Eric Smith" <eric.smith@THRWHITE.remove-dii-this>
Date2011-04-27 15:31 +0000
SubjectRe: Parsing or Casting a
Message-ID<qhirdlefoi.fsf@ruckus.brouhaha.com>
In reply to#1062
  To: comp.lang.java.gui
Tamer Higazi <no@mail.de> writes:
> From the runtime the values in a JTextField have to be assigned to a
> variable with the following datatype:
> 
> short
> byte
> int
> 
> I don't know how to do that!

I explained it in my followup, which you even quoted.

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.java.gui


csiph-web