Skip to content

Instantly share code, notes, and snippets.

@figengungor
Created March 11, 2013 22:57
Show Gist options
  • Select an option

  • Save figengungor/5138702 to your computer and use it in GitHub Desktop.

Select an option

Save figengungor/5138702 to your computer and use it in GitHub Desktop.
Java GUI >> JTextArea
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JTextArea;
public class MyGUI extends JFrame {
JPanel jp;
JTextArea jt;
public MyGUI(){
setTitle("JTextArea Example");
setSize(600,600);
setVisible(true);
setDefaultCloseOperation(EXIT_ON_CLOSE);
jp = new JPanel();
jt = new JTextArea(10,50); //rows, columns
jp.add(jt);
add(jp);
validate();
}
public static void main(String [] args) {
new MyGUI();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment