about select() in JTextArea?
i wrote the following codes,but the select() didnt work, :( why?
could you help me?please....
import java.awt.BorderLayout;
import java.awt.Container;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JTextArea;
public class TrySelect {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
JFrame frame = new JFrame("TrySelect");
Container c = frame.getContentPane();
final JTextArea t= new JTextArea();
c.add(t);
JButton b = new JButton("Select");
c.add(b,BorderLayout.SOUTH);
b.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){
t.select(5, 10);
}
});
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setBounds(120, 200,400,500);
frame.setVisible(true);
}
}
thanks a lot!

