🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.api
Article #665

Re: int or float

#665
From: RaynorPao
Date: Fri, 11 Apr 2003 14:06
24 lines
1599 bytes
Hi TorIver & Kevin:

Thanks for your reply.
I found a solution like this as below:

    try {
      Integer.parseInt(str);
      jTextField1.setText("int");
    }
    catch(NumberFormatException e1) {
      try {
        Float.parseFloat(str);
        jTextField1.setText("float");
      }
      catch(NumberFormatException e2) {
        jTextField1.setText("Not int or float");
      }
    }

But, I'm not sure it is OK or not.
Any suggestion, please?

Thanks.
RaynorPao.
Technical Details
Message-ID: <3e96c819$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!newshosting.com!news-xfer1.atl.newshosting.com!nntp1.fuse.net!news-out.newsfeeds.com!propagator2-maxim!news-in.spamkiller.net!propagator3-maxim!news-in.superfeed.net!newsfeed01.tsnz.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <3e959322@newsgroups.borland.com> <u65pl1rxk.fsf@ergo.no>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 1089d0,e40b384e2aa5f880
X-Google-Attributes: gid1089d0,public
X-Google-ArrivalTime: 2003-04-11 06:53:25 PST
From: "RaynorPao" <RaynorPao.nospam@nospam.pchome.com.tw>
Newsgroups: borland.public.jbuilder.java.api
References: <3e959322@newsgroups.borland.com> <u65pl1rxk.fsf@ergo.no>
Subject: Re: int or float
Date: Fri, 11 Apr 2003 22:06:33 +0800
Lines: 26
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4807.1700
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
NNTP-Posting-Host: 61.221.176.28
Message-ID: <3e96c819$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1050069017 61.221.176.28 (11 Apr 2003 06:50:17 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!newshosting.com!news-xfer1.atl.newshosting.com!nntp1.fuse.net!news-out.newsfeeds.com!propagator2-maxim!news-in.spamkiller.net!propagator3-maxim!news-in.superfeed.net!newsfeed01.tsnz.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail