Re: Creating JTextArea on main window of app ?



<gethostbyname@xxxxxxxxx> wrote in message
news:1172460407.485560.119190@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On 25 fev, 23:56, "gethostbyn...@xxxxxxxxx" <gethostbyn...@xxxxxxxxx>
wrote:
Look a simple working source code:

-------------------------------------------------------------
package javaapplication3;

import javax.swing.JFrame;
import javax.swing.JTextArea;

public class Main extends JFrame {
private JTextArea textArea;

public Main() {
super("PH");

setSize(500,500);
setVisible(true);

textArea = new JTextArea();
getContentPane().add(textArea);


Forgive me. Put

setVisible(true);

after the

getContentPane().add(textArea);

Maybe, this is your source code problem too.


}

public static void main(String[] args) {
Main application = new Main();
application.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}

}

-------------------------------------------------------------

gethostbyname
Hi
Thanks for the help.That item working now. Onto next problem
Tony


.