Results 1 to 10 of 10
- 01-03-2011, 07:30 AM #1
Member
- Join Date
- Jan 2011
- Posts
- 7
- Rep Power
- 0
paste special symbols in JTextField
Hi,
I am unable to see the special symbols like greek character set when copied from character map of windows and pasted in the JTextField.
eg: when I copy alpha, beta symbols from character map and paste in text field they are displayed as a,b respectively instead of displaying their actual symbols
Regards,
Kumar
- 01-03-2011, 10:18 AM #2
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,399
- Blog Entries
- 7
- Rep Power
- 17
- 01-03-2011, 10:33 AM #3
Member
- Join Date
- Jan 2011
- Posts
- 7
- Rep Power
- 0
Hi Jos,
I tried setting the font of the JTextField to Arial MS Unicode font, but invain.
Regards,
Kumar
- 01-03-2011, 11:05 AM #4
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,399
- Blog Entries
- 7
- Rep Power
- 17
- 01-03-2011, 11:23 AM #5
Member
- Join Date
- Jan 2011
- Posts
- 9
- Rep Power
- 0
Maybe a stupid question, but are you actually copying 'alpha' and 'beta' characters (U+03B1 and U+03B2), or are you copying the 'a' and 'b' characters from the Symbol font?
(Hope this works)
Try: α β
- 01-03-2011, 11:42 AM #6
Member
- Join Date
- Jan 2011
- Posts
- 7
- Rep Power
- 0
Hi Aeroren,
As I have mentioned in my first post, I am getting the problem when I am trying to copy the greek symbols from character map of windows (start->programs->accessories->system tools->character map) and paste in the text field in the swing application.In the other cases I guess it will work.
- 01-03-2011, 12:01 PM #7
Member
- Join Date
- Jan 2011
- Posts
- 9
- Rep Power
- 0
Yes, but are you copying the 'a' and 'b' from the Symbol font, or actually copying alpha and beta, which are a lot further down? The 'a' and 'b' from the Symbol font aren't actually an alpha and beta, Symbol simple draws the 'a' and 'b' that way. If you paste them in another window that uses a different font, they won't look like alpha an beta anymore.
But if you only wish to use Greek characters you can change the font of your textfield to Symbol.
- 01-03-2011, 12:07 PM #8
Member
- Join Date
- Jan 2011
- Posts
- 7
- Rep Power
- 0
Hi Aeroren,
Thnx for your quick reply...I am copying the actual α ,β symbols that you can find in the character map of windows when you select symbols in the drop down list. I could see the actual symbols when I try to paste the same in text document but I am getting a,b when I say ctrl+v to paste the same in the text field
- 01-03-2011, 01:04 PM #9
Member
- Join Date
- Jan 2011
- Posts
- 9
- Rep Power
- 0
Now I'm kinda confused... :) Did you copy the alpha and beta characters in your post from mine or from the charmap?
Anyway, to be sure I created a simple JFrame with a JTextField in it and it accepts the alpha character as it should, without setting any parameters (i just used this.add(new JTextField()); ) The AWT version also works by the way.
Now, there might be different versions of the CharMap, but the one I'm using (Windows Vista) only has a dropdown list for font. If that's what you're using to change it to "Symbol" than that means you're not actually copying an alpha character but Symbol's representation of an 'a' (which happens to look like an alpha). If you paste this in a program like word, it will copy the font along and it will still look like an alpha. If, however, you copy the text to a field with another font (like notepad, this forum or your JTextField) it will look like an 'a'. In order to get the actual alpha character (UTF16 0x03B1) you need to select a font like Arial and scroll down about a third of the way. There you'll find the actual alpha and beta characters
- 01-03-2011, 01:17 PM #10
Member
- Join Date
- Jan 2011
- Posts
- 7
- Rep Power
- 0
Similar Threads
-
Checking If A String Contains Symbols
By SwissR in forum New To JavaReplies: 7Last Post: 07-27-2010, 09:07 AM -
Representing ERD with symbols
By vivvy in forum JDBCReplies: 1Last Post: 02-17-2010, 05:17 PM -
Running system comman with special symbols using Runtime.exec()
By sda in forum New To JavaReplies: 0Last Post: 07-13-2009, 05:22 PM -
Plotting Symbols in Java 2D
By cowboy007 in forum Java 2DReplies: 1Last Post: 03-08-2009, 01:13 PM -
How to cut symbols from a string?
By gutters in forum New To JavaReplies: 3Last Post: 06-16-2008, 03:47 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks