File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes Monospaced font on a JMenuItem Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply Bookmark "Monospaced font on a JMenuItem" Watch "Monospaced font on a JMenuItem" New topic
Author

Monospaced font on a JMenuItem

colin shuker
Ranch Hand

Joined: Apr 11, 2005
Posts: 712
Hi, I'd like to use a monospaced font within a JMenuItem's text.
I guess its possible to use html to do this inside the String, but this plays up when you use spaces.

Is there another way, eg using Fonts?

Thanks
Darrin Cartwright
Ranch Hand

Joined: Dec 27, 2002
Posts: 107
Sure, just use the following:

Or were you wanting only a portion of the text to be monospace?
[ May 18, 2007: Message edited by: Darrin Cartwright ]

Life is good on the Ponderosa,<br />but mind where you step.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Monospaced font on a JMenuItem
 
Similar Threads
JTextArea display
Print plain text with Printable interface
problem with spacing of text in JTextArea
Tips on using this discussion software
Why the result of printing out the not-letter chars to console is different from to applets