Why the same font in Java looks different?

Java font coloring please?

  • I'm trying to make a little online battleship game with the board on left side and jtextarea/jtextpane/jeditorpane on the right side to display chat messages and messages like "guess at A6 is a miss" and for chat messages i need black font and for messages from the app i want red font in it. I know you cant have multiple font colors with JTextAreas so I want to have a class that extends jtextpane/jeditor pane and just need someone to give me a couple methods like println(String s) and printLnRed so that It makes life easier

  • Answer:

Punitha J at Yahoo! Answers Visit the source

Was this solution helpful to you?

Other answers

Take a look at JTextPane. It has support for marking up text with style sheets. Here's a overview from the Java website: http://docs.oracle.com/javase/tutorial/uiswing/components/text.html

godfatherofsoul

Take a look at JTextPane. It has support for marking up text with style sheets. Here's a overview from the Java website: http://docs.oracle.com/javase/tutorial/uiswing/components/text.html

godfatherofsoul

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.