Results 1 to 4 of 4
Thread: Returning a string (Partly Bold)
- 02-01-2008, 05:35 PM #1
Member
- Join Date
- Jan 2008
- Posts
- 8
- Rep Power
- 0
Returning a string (Partly Bold)
Ok here is my deal --
I am a little new at this and still learning, so keep it as informative as possible please (include imports, etc).
I have a public class
public class BoldMyString {
protected String getLetterBody() {
return "This string is not bold. This string is bold.\r\rNow this string is not bold.";
}
How do I get "This string is bold" to show up in bold lettering??
Thanks All.
- 02-01-2008, 06:11 PM #2
Displaying
Hello TampaTechGuy
If you want to display text with bold styling, then you must use a graphical user interface or GUI. I don't think that console programs where designed for formatting the style of text. (example: Windows Command Prompt)Eyes dwelling into the past are blind to what lies in the future. Step carefully.
- 02-01-2008, 06:24 PM #3
Member
- Join Date
- Jan 2008
- Posts
- 8
- Rep Power
- 0
Its part of a web application I'm working on --
There are pieces of it that use:
new Font(Font.TIMES_ROMAN, 8, Font.ITALIC)));
but I am stuck on how to apply this to my code in a different class.
*but bold, not italic of course.
- 02-03-2008, 09:54 AM #4
Graphics
Hello TampaTechGuy
I would use the Graphics class to draw text. Then you can add any formatting that you can think of! See the last picture in this thread. I formated the text and added some layout so that it is displayed around images. You can do this if you like, but Swing or AWT components will offer a faster solution. :DEyes dwelling into the past are blind to what lies in the future. Step carefully.
Similar Threads
-
Need help returning data from database
By dyn03 in forum JDBCReplies: 0Last Post: 03-11-2008, 04:55 PM -
JNI - passing and returning parameters by value
By java_to_c in forum New To JavaReplies: 0Last Post: 01-31-2008, 08:49 PM -
How to add interceptor to persistent ejb entity to add check before returning values
By umen in forum Enterprise JavaBeans (EJB)Replies: 0Last Post: 11-30-2007, 11:55 PM -
returning to a previously saved view
By gojava in forum Advanced JavaReplies: 0Last Post: 11-09-2007, 05:11 PM -
selectSingleNode not returning element...
By schu777 in forum XMLReplies: 4Last Post: 07-31-2007, 05:19 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks