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 / First Aid / March 2004

Tip: Looking for answers? Try searching our database.

square root symbol on button

Thread view: 
David Heath - 12 Mar 2004 05:46 GMT
I need to place the square root symbol on a button. The code for the
symbol is 251, but I'm not sure how to place that on the button. Any
help will be appreciated.

Dave
Chris Smith - 12 Mar 2004 06:14 GMT
> I need to place the square root symbol on a button. The code for the
> symbol is 251, but I'm not sure how to place that on the button. Any
> help will be appreciated.

No, it's not -- at least in Unicode.  In Unicode, 251 decimal is a u
with accent-circumflex, and 251 hex is a latin lower-case 'alpha'
character.  There is a square root symbol at hex 221A (or decimal 8730).  
Perhaps byte value 251 maps to a square root symbol in some encoding
somewhere, but I'm not familiar with such an encoding.  In any case,
once you've actually got the right value (and www.unicode.org/charts 
helps there), you can use \u221A to include it in a text string.

The next challenge is to be sure you are using a font capable of
displaying that symbol.

Signature

www.designacourse.com
The Easiest Way to Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation

Tom - 12 Mar 2004 13:43 GMT
> I need to place the square root symbol on a button. The code for the
> symbol is 251, but I'm not sure how to place that on the button. Any
> help will be appreciated.
>
> Dave

If you are using a (javax.swing) JButton rather than (java.awt)
Button, then you could display a graphical image on the button.  I
tried using the 2nd power character once and found that it didn't
display correctly on all platforms.  Using the image would avoid that
problem, and (if you create the image file) give you more control over
how it looks.
David Heath - 13 Mar 2004 17:48 GMT
Thank you both, Chris and Tom. I looked at both of your options and have
decided that putting an image on the button looks best.

By the way Chris, 251 is the ascii extended decimal code. The unicode
you suggested works better. Thanks for the heads up.

Dave

> I need to place the square root symbol on a button. The code for the
> symbol is 251, but I'm not sure how to place that on the button. Any
> help will be appreciated.
>
> Dave
Jon A. Cruz - 13 Mar 2004 18:19 GMT
> By the way Chris, 251 is the ascii extended decimal code. The unicode
> you suggested works better. Thanks for the heads up.

No, it's not.

There's no such thing as "ascii extended".

ASCII is a 7-bit encoding with values from 0 through 127. Anything else
(especially anything 8-bit) is some other encoding.

Saying "ascii extended" is a little bit like saying "Non-C++ computer
language". It's just about as potentially vague.

It might be ISO-8859-1, codepage 1252, codepage 850, codepage 437, etc.

To let you know, Windows usually uses Cp1252, but most DOS and Microsoft
command prompts use Cp850 on the same computer (which is one reason why
System.out.println() can have problems).

Back in Windows 3.1 days Microsoft used to use Cp437.

Being precise with terminology helps in cases like this.
David Heath - 14 Mar 2004 00:36 GMT
Well Jon, do a web search for "ascii extended" turns up 942 pages so it
seems I'm not the only one who has used the term.

As for the rest of it I could care less. Maybe you could of gotten a
clue what I was asking if you could remove you head from your anus. Was
that precise enough for you to understand.

>> By the way Chris, 251 is the ascii extended decimal code. The unicode
>> you suggested works better. Thanks for the heads up.
[quoted text clipped - 18 lines]
>
> Being precise with terminology helps in cases like this.
Andrew Thompson - 14 Mar 2004 01:04 GMT
> Well Jon, do a web search for "ascii extended" turns up 942 pages so it
> seems I'm not the only one who has used the term.

Well David, if you google
http://www.google.com/search?&q=idiot+author+web+page
You get 226,000 hits..  

Now, what does _that_ mean?

Signature

Andrew Thompson
* http://www.PhySci.org/ Open-source software suite
* http://www.PhySci.org/codes/ Web & IT Help
* http://www.1point1C.org/ Science & Technology

[ ..and please feel free to go trawling through
my many web-pages looking for spelling and other
mistakes, they probably need some edit checking.  ;-) ]

Matt Parker - 14 Mar 2004 02:51 GMT
> Well Jon, do a web search for "ascii extended" turns up 942 pages so it
> seems I'm not the only one who has used the term.
>
> As for the rest of it I could care less. Maybe you could of gotten a
> clue what I was asking if you could remove you head from your anus. Was
> that precise enough for you to understand.

1) Don't top post.
2) There is no such "standard" as ASCII Extended
3) ASCII above 127 displays differently on different platforms
4) Webpage authors don't always know what they are talking about
5) Don't be a prick
6) Go back to Visual Basic

Matt

Signature

Not so interesting...
http://www.mpcontracting.co.uk

Roedy Green - 16 Mar 2004 00:24 GMT
>2) There is no such "standard" as ASCII Extended

The problem is there are hundreds of ways of extending ASCII to 8
bits.  One nice thing about Unicode 16 is there is so far only one set
of glyphs.

--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
Jon A. Cruz - 14 Mar 2004 05:37 GMT
> Well Jon, do a web search for "ascii extended" turns up 942 pages so it
> seems I'm not the only one who has used the term.

No. That I'm well aware of.

It's also happend more than once that new computer users have complained
about the "cup holder" when they actually should have said "CD-ROM
tray". (Try a google search of that. You get 28,500 pages, so it must be
even more valid).

> As for the rest of it I could care less. Maybe you could of gotten a
> clue what I was asking if you could remove you head from your anus. Was
> that precise enough for you to understand.

Yes. Very.

I pointed out that you were making a mistake and not knowing to look for
something in order to get the answers you needed. You seem to have
decided that you don't need to bother.

I've pointed out something that you need to know, especially with Java
and it's String<-->byte<-->string conversions. If you choose to ignore
it, that's entirely your prerogative.

This issue is much like the users coming in asking about which "java
compiler" to use. In the vast majority of cases they don't really care
as much about "compiler", but instead really need to be directed to look
for "Java IDE". Telling them so usually allows them to get better hits
on their searches and helps them get solutions faster.
Chris Smith - 14 Mar 2004 17:00 GMT
> Thank you both, Chris and Tom. I looked at both of your options and have
> decided that putting an image on the button looks best.
>
> By the way Chris, 251 is the ascii extended decimal code. The unicode
> you suggested works better. Thanks for the heads up.

Glad you solved your problem.  If you plan on sticking with Java, or
writing cross-platform code in any other language for that matter, you
really need to pay attention to what Jon said.  The term "extended
ASCII" has no real definition, but is often used to describe one of any
number of 8-bit character encodings that share the first 128 values with
ASCII.

When I saw your question, I checked ISO 8859-1 and Windows CP1252 (two
encodings that are different, but are *both* frequently referred to as
"extended ASCII") and found that 251 is not a square-root sign in either
of them.  I still don't know which "extended ASCII" character encoding
you were assuming when you asked that question.  (Perhaps the old DOS
one?  I am forgetting its technical name, so I didn't check it to find
if there's a square-root symbol at decimal 251 there.)

Signature

www.designacourse.com
The Easiest Way to Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation



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.