Pessoal,
tenho um JTextArea que não é editável - SetEditable(false)…
Porém precisava que o cursor ficasse visivel nele para que eu tivesse uma referencia no texto… alguem sabe como?
Pessoal,
tenho um JTextArea que não é editável - SetEditable(false)…
Porém precisava que o cursor ficasse visivel nele para que eu tivesse uma referencia no texto… alguem sabe como?
import javax.swing.*;
/* autor heliofrota
* editado no GNU Emacs
*/
public class CursorTextArea extends JFrame {
public CursorTextArea() {
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setSize(300,300);
setVisible(true);
JTextArea x = new JTextArea();
x.setText("text area desabilitado com focus...");
x.setEditable(false);
x.getCaret().setVisible(true);
x.requestFocus();
JPanel p = new JPanel();
p.add(x);
add(p);
pack();
}
public static void main(String args[]) {
new CursorTextArea();
}
}
Deu certo cara ?
Foi mal a demora,
Cara deu certinho!!! vlw mesmo!!!