473,383 Members | 1,762 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

How to get greek "mu"-symbol in JLabel-text?

42
Hi all!
I want a mu (the micro symbol) in the text property of a JLabel.
(I want to be able to display the unit micro-seconds as "mu"s...)
Can anyone help me with that, pretty please?
Oct 26 '07 #1
4 14966
r035198x
13,262 8TB
Hi all!
I want a mu (the micro symbol) in the text property of a JLabel.
(I want to be able to display the unit micro-seconds as "mu"s...)
Can anyone help me with that, pretty please?
Open the API specs for the JLabel class (first hit on google if you search for "JLabel.java 6"). You will see the constructor which takes a String and also the setText method.
Oct 26 '07 #2
MimiMi
42
Thanks for answering and sorry for not being clear enough. The question should have been "How do I get a greek "mu"-symbol in a java string?"
I already knew how to set a JLabel text, that wasn't the problem, but anyhow thank you for taking the time to answer, that was nice of you!

Found out the answer myself. This is really what I wanted:
Expand|Select|Wrap|Line Numbers
  1. String microSeconds = "\u00B5"+"s";
  2.  microSecondsjLabel.setText(microSeconds);
Oct 26 '07 #3
JosAH
11,448 Expert 8TB
Found out the answer myself. This is really what I wanted:
Expand|Select|Wrap|Line Numbers
  1. String microSeconds = "\u00B5"+"s";
  2.  microSecondsjLabel.setText(microSeconds);
Good; put this link in your bookmarks. That
site shows all codepoints for all available characters.

kind regards,

Jos
Oct 26 '07 #4
I see you found the answer there are 2 ways I know of:
In this example I want to show the degree celcius symbol in the label:

1) using html codes (note the <HTML> tag in front of the label
JLabel label = new JLabel("<HTML>Temperature &deg;C");

2) using unicode (the same as you have already found)
JLabel label = new JLabel("Temperature \u00B0C");

I personally think the html version is more readable.
Oct 11 '10 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Yannick Turgeon | last post by:
Hello all, We are currently changing our web server and, in the process, updating PHP version from 4.3.0 to 4.3.5. The problem we've got is that our PHP applications generate errors saying that...
4
by: Phil Powell | last post by:
re: http://us4.php.net/manual/en/function.imagegif.php I have one class method that resizes images, including GIF images, and works just fine doing so, even up to this line: eval('image' ....
3
by: Sean Berry | last post by:
How do I rectify this? ------vars.py------ #!/usr/local/bin/python def setUserid(value): userid = value def getUserid():
3
by: Jim Higson | last post by:
Does anyone know a technique in javascript to transform from (for example) &hearts; to the char '‚ô•'? I'm doing this because I have to interpret some data I got over XHTMLHTTP that isn't XML,...
7
by: James Johnson | last post by:
Are there structs in JavaScript? If not, what's the closest thing, or do I just use parallel arrays? I'm populating a JavaScript array from ColdFusion query, but I don't think I can do this: ...
3
by: Bri | last post by:
AC97 on WinXP, Image control on a Form and on a Report. I have followed the advice on the following MVPS page: http://www.mvps.org/access/api/api0038.htm This states that after changing the...
3
by: John Nagle | last post by:
I have XML replies in a DOM which contain entity escapes, like "&amp;". What's the proper way to replace them with the ordinary characters? Preferably something that will work in most browsers? I...
5
by: Lakesider | last post by:
Hi NG, I have a question about data: I have travel-times from A to B like this from | to | sec. A B 17 A B 18 A B 30 A B 32
3
by: DrVitoti | last post by:
On that program the compiler says "parse error" on line 8, 10, 12 and 21, it also says "too many arguments" on lines 10, 12 and finally it says "at this port in" on lines 13, 14, 20 . How could I...
4
by: Kurt Mueller | last post by:
How to (super)split a string (literal) containing " and/or ' and/or \<sep>. example: ' a " b b " c\ c '.supersplit(' ') -> Thanks and GrŁessli
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.