Swing provides two distinct types of text components: simple text controls that can only display one font and one color at a time and styled text components that can display multiple fonts and colors. The former are text fields (
JTextField), password fields (
JPasswordField), and text areas (
JTextArea); the latter are editor panes (
JEditorPane) and text panes (
Text fields and text areas are useful for editing plain text.
JTextArea are nearly source compatible with their AWT counterparts: ...