I'm trying to make a calculator program in java, but I'm not sure how to center the text in my JTextArea. I've tried searching google and YouTube, but I don't find anything. Here is my source code:
import javax.swing.*;
import java.awt.*;
public class Sect1 extends JTextArea{
public static final Dimension ss = Toolkit.getDefaultToolkit().getScreenSize();
public Sect1(){
this.setBounds(ss.width / 4, ss.height / 5, 100, 100);
this.setLineWrap(true);
this.setWrapStyleWord(true);
}
}