my dog learned polymorphism*
The moose likes Java Micro Edition and the fly likes Changing the text color Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "Changing the text color" Watch "Changing the text color" New topic
Author

Changing the text color

sara shamsi
Greenhorn

Joined: May 07, 2004
Posts: 3
Dear all ..
How can I change the color of text with out using "graphic g"??
good bye
sara
David Price
Ranch Hand

Joined: Jan 22, 2003
Posts: 93
I guess you mean: "How can I change the text colour in MIDP high-level UI screens (Form, List, TextBox)?". The simple answer is: you can't - these screens use the phone's native fonts and colour settings.
You can only change the text colour in MIDP low-level UI screens (Canvas, MIDP 2.0 GameCanvas) and in MIDP 2.0 'CustomItems' (items on a form which are each like a little Canvas). These all use that 'Graphics g'.
sara shamsi
Greenhorn

Joined: May 07, 2004
Posts: 3
Thank you David ..
ok if I can't change the text colour in MIDP high-level UI screens... can I highlights the text ??
Sara
Michael Yuan
author
Ranch Hand

Joined: Mar 07, 2002
Posts: 1427
You can underline text, make it bold or use any supported font in the high level API. Refer to the "Font" and StringItem" classes in the javadoc.


Seam Framework: http://www.amazon.com/exec/obidos/ASIN/0137129394/mobileenterpr-20/
Ringful: http://www.ringful.com/
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Changing the text color