Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Drawing strings in Java

Drawing strings in Java
Thread Tools
Mac Enthusiast
Join Date: Sep 2000
Location: Vermont, USA
Status: Offline
Reply With Quote
Apr 2, 2001, 01:21 AM
 
Does anyone know how to draw strings in an NSView in Java? I am working on an application where I would like to draw strings (numbers and text) in different areas of an NSView.

There was an earlier thread addressing this question for Objective C, but I am wondering how one might do it in Java. I am a novice programmer so any help and descriptive instructions would be great!

Thank you.
     
Mac Enthusiast
Join Date: Sep 2000
Location: Vermont, USA
Status: Offline
Reply With Quote
Apr 19, 2001, 12:45 AM
 
I realized that I can use a NSTextField:

NSTextField field;
field.setStringValue("put in whatever here");

Although this is a little limited it works well for my needs.
     
ali
Forum Regular
Join Date: Sep 2000
Status: Offline
Reply With Quote
Apr 19, 2001, 02:04 AM
 
There is also:

NSGraphics.drawAttributedString(NSAttributedString , NSRect);

NSGraphics.drawAttributedString(NSAttributedString , NSPoint);


There seems to be no drawString(), which would also be handy.

See NSAttributedString for creating attributed strings with various styles....

Ali

     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 02:51 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2