import javax.swing.*; public class TextAreaExample { public static void main(String[] args) { JTextArea textArea = new JTextArea(10, 20); textArea.setFont(new Font("Serif", Font.BOLD, 16)); JScrollPane scrollPane = new JScrollPane(textArea); JFrame frame = new JFrame("Text Area Example"); frame.setContentPane(scrollPane); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setSize(400, 400); frame.setVisible(true); } }In the above example, a JTextArea is created with 10 rows and 20 columns. The setFont method is then used to set the font of the text to a bold serif font with size 16. Finally, the JTextArea is added to a JScrollPane and the JScrollPane is added to a JFrame. The package library used in this example is javax.swing.