1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
| import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class awtextinp extends JFrame {
Container mycontainer = null;
public awtextinp (String title )
{
super(title);
mycontainer = this.getContentPane();
mycontainer.setLayout(new BorderLayout());
final JTextArea mytextarea = new JTextArea();
mytextarea.setLineWrap(true);
JScrollPane myscrollpan = new JScrollPane(mytextarea);
this.addWindowListener (new WindowAdapter(){
public void windowClosing(WindowEvent e){
System.exit(0);
}
});
this.setSize(500,300);
this.setVisible(true);
}
public static void main(String[] args) {
awtextinp myapp = new awtextinp("my editor");
}
}
|