hossein71
چهارشنبه 11 آبان 1390, 17:09 عصر
سلام
من بوسیله کدنویسی یک JTextArea ساختم ولی در هنگام اجرای برنامه نمایش داده نمیشه.
import java.awt.Color;
import java.awt.Font;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JTextArea;
public class Testclass extends JFrame {
JPanel P;
JTextArea TA;
public Test(){
this.P=new JPanel();
this.setContentPane(P);
this.TA=new JTextArea();
P.add(TA);
TA.setBounds(10, 10, 100, 100);
TA.setBackground(Color.red);
}
public static void main(String[] args) {
new Testclass().setVisible(true);
}
}
من بوسیله کدنویسی یک JTextArea ساختم ولی در هنگام اجرای برنامه نمایش داده نمیشه.
import java.awt.Color;
import java.awt.Font;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JTextArea;
public class Testclass extends JFrame {
JPanel P;
JTextArea TA;
public Test(){
this.P=new JPanel();
this.setContentPane(P);
this.TA=new JTextArea();
P.add(TA);
TA.setBounds(10, 10, 100, 100);
TA.setBackground(Color.red);
}
public static void main(String[] args) {
new Testclass().setVisible(true);
}
}