Các bác cho em hỏi , em có bài java swing e mắc ở chỗ làm thế nào để cái textarea bên giao diện để setCaretPosition
Hỏi cách gọi text area bên giao diện sang class.java
To use an instance variable of other class (not object), you need to set the variable to static and access it by its class
For example:
Public class mainGUI {
private static JTextArea areaContent;
static JTextArea getAreaContent(){
return areaContent;
}
}
Public class FindGUI {
private JTextArea textArea = mainGUI.getAreaContent();
}
P/s: Sorry, Unikey is broken, so I cant type Vietnamese, hope you get what I answer 
2 Likes
83% thành viên diễn đàn không hỏi bài tập, còn bạn thì sao?