السلام عليكم...
لدي واجهة برنامج شات ويوجد فيها متغيرين من نوع TextArea ....
رتبتهم في الشاشه عبر إحداثيات الـ x,y...
ولدي مشكله اني كلما كتبت في الـ TextArea ونزلت إلى الأسفل الكتابه تنزل ولا استطيع الوصول إليها فحاولت وضع scrollPane ولكنها لم تظهر معي في الشاشه...
وهذا هو الكود
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.io.*;
import java.net.*;
public class Chat extends JFrame
{
JTextArea show,write;
JButton send;
JLabel pic;
public Chat()
{
super("Chat");
//Container con1=getContentPane();
//con1.setLayout(new BorderLayout());
Container con=getContentPane();
con.setLayout(null);
//Box box=Box.createVerticalBox();
show=new JTextArea(" ",400,300);
show.setBounds(new Rectangle(0,0,400,300));
show.setEditable( false );
show.setLineWrap(true);
//con.add(new JScrollPane(show));
//JScrollPane p1=new JScrollPane(show);
write=new JTextArea(400,100);
write.setBounds(new Rectangle(0,320,400,100));
write.setLineWrap(true);
write.setWrapStyleWord(true);
JScrollPane p1=new JScrollPane(write);
p1.setLayout(null);
send=new JButton("send");
send.setBounds(new Rectangle(420,320,100,100));
con.add(p1);
con.add(show);
con.add(write);
con.add(send);
//add(box);
setSize(540,460);
setVisible(true);
}
public static void main(String []args)
{
Chat x=new Chat();
x.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
}أرجو منكم المساعده
ولكم خالص تقديري....
