다른 JFrame에서 JFrame을 업데이트하고 싶습니다. 나는 같은 그룹 이름을 가진 두 개의 유사한 인터페이스를 가진 기본 프로그램을 가지고 있는데, 어떻게 프로그램을 코딩 할 수 있는지 알고 싶다. 그래서 한 사람이 그룹 이름을 변경하면 자동으로 다른 프로그램이 바뀌게된다. 사전자바의 다른 JFrame에서 JFrame을 업데이트하는 방법
먼저 인터페이스
Public String groupNam;
private void groupNActionPerformed(java.awt.event.ActionEvent evt) {
interface2 interface2 = new interface2();
groupNam = groupN.getText();
interface2.group.equals(groupNam); //interface2 is the class name of the other interface
}
두 번째 인터페이스
private void groupNameActionPerformed(java.awt.event.ActionEvent evt) {
groupName.getText().equals(groupNam); //calling the public string from interface 1 and placing it in groupName field
}
이, 그러나 그것은 작동하지 않았다 내 시도였다에서
감사합니다.
해결책에 대한 귀하의 시도를 묘사하는 관련 코드를 보여주십시오. – Tdorno