The JTextArea class in swing is used to create a text area. It is a multiline area that displays the plain text only. The JTextArea having following constructors.
Let's see an example of JTextArea class:
Let's see an example of JTextArea class: import java.awt.Color; import javax.swing.*; public class JTextAreaDemo { JTextArea area; JFrame f; JTextAreaDemo(){ f=new JFrame(); area=new JTextArea(200,200); area.setBounds(10,30,200,200); area.setBackground(Color.blue); area.setForeground(Color.white); f.add(area); f.setSize(300,300); f.setLayout(null); f.setVisible(true); } public static void main(String[] args) { new JTextAreaDemo(); } }
Silan Software is one of the India's leading provider of offline & online training for Java, Python, AI (Machine Learning, Deep Learning), Data Science, Software Development & many more emerging Technologies.
We provide Academic Training || Industrial Training || Corporate Training || Internship || Java || Python || AI using Python || Data Science etc