Java 2D Graphics Text

Java examples for 2D Graphics:Text

Description

Click the following links for the tutorial for 2D Graphics and Text.

  1. Display strings in different fonts and colors.
  2. Map a graphical location to a character position within text in Java 2D
  3. Java 2D Define and render the graphics and text
  4. Java 2D Create Antialiased Text
  5. Java 2D Text Respond to left and right arrow keys with TextLayout
  6. Java 2D Text Draw text with font Text Attribute
  7. Java Map a graphical location to a character position within Unicode text
  8. Layout paragraph text by Breaking text to next line with LineBreakMeasurer and TextLayout


  9. Java Select text with TextLayout
  10. Java Draw simple text string
  11. This example displays ASCII digits, 0 through 9, as Arabit digits
  12. Create TextLayout from TextAttribute and Layout String
  13. Paint text with various font using FontRenderContext
  14. Create Bidirection Text display
  15. Word boundary break with BreakIterator
  16. Colored Hello World


  17. Getting the Dimensions of Text From within a component
  18. Getting the Dimensions of Text From within the paint() method
  19. Getting the Shape from the Outline of Text
  20. Drawing Simple Text
  21. Drawing a Paragraph of Text
  22. Drawing Rotated Text
  23. Draw a given String to a Graphics2D object
  24. Draw a given String to a graphic object as big as possible but still stay within given dimension.
  25. Draw a given String to a graphic object centered
  26. Draw string with alignment
  27. draw Missing Texture
  28. Draw a string of text centered in the given Graphics object.
  29. Draws a line, using the current color, between the points in this graphics context's coordinate system.
  30. Draw a text in the center of the bounds.
  31. Calculate the start point for drawing a TextLayout.
  32. Calculate the origin points that are used to draw a list of TextLayouts.
  33. get Text Height
  34. get Text Width
  35. Draws text in red with appropriate word wrap.
  36. draw Centered String
  37. draw String
  38. draw Shadow Text
  39. Draws the specified string on the specified graphics wrapped to the specified width.
  40. Enables anti-aliasing for both text and other elements for the supplied 'g' Graphics object.
  41. draw Centered Text
  42. draw Text
  43. get Text Bounds
  44. centering Text
  45. Generates a TexturePaint of the given size, using the given text as a pattern.
  46. get Text Color from background color
  47. highlight Text
  48. shadow Text
  49. measure Text Pixels
  50. draw String Centered At
  51. measure String Height
  52. measure String Width
  53. draw Wrapped String
  54. Draws the specified string with a drop shadow
  55. Draws a string centered at a certain x-coordinate
  56. draw String Align Center
  57. draw String within range
  58. draw Trimmed String
  59. Attempts to parse an RGB triplet or an RGBA quadruplet from the string.
  60. draw String Array
  61. performs the annoying calculation required for centering text in a box of size d.
  62. Creates a multiline text outline shape using a center alignment
  63. Draw a string.
  64. draw String Centered
  65. Draws the given String on the given Graphics2D aligned to the top center of the bounding rectangle.
  66. Draws the given String on the given Graphics2D aligned to the top left of the bounding rectangle.
  67. Draws the given multi-lined string on the given graphics with a given horizontal and vertical alignment.
  68. Draws the given string on the given graphics with a given horizontal and vertical alignment and with an outline of a given width and color.
  69. Draws the given String on the given Graphics2D aligned to the top right of the bounding rectangle.
  70. Draws the given string on the given graphics with a given horizontal and vertical alignment.
  71. Draws the given String on the given Graphics2D aligned to the left center of the bounding rectangle.
  72. Draws the given String on the given Graphics2D aligned to the top left and line wrapped inside of the the bounding rectangle.
  73. A utility method that calculates the anchor offsets for a string.
  74. Draws a string such that the specified anchor point is aligned to the given (x, y) location, and returns a bounding rectangle for the text.
  75. Draws a string that is aligned by one anchor point and rotated about another anchor point.
  76. Draws the given String on the given Graphics2D aligned to the very center of the bounding rectangle.
  77. outline Text
  78. paint Drop Shadowed Text
  79. paint Text
  80. Returns the bounds for the specified text.
  81. Count the line number from JTextComponent.
  82. Get last visible line of the text component in a JScrollPane.
  83. Given an offset, returns the column number in a text component.
  84. Returns the line number of the caret in a text component.
  85. Given an offset, returns the line number of a text component.
  86. Used for cutting off text that is too wide.
  87. draw Boundary