본문 바로가기
728x90

Java10

keyTyped(KeyEvent e) 메소드내에서의 KeyEvent.VK_BACK_SPACE 오류 관련. keyTyped(KeyEvent e) 메소드내에서의 KeyEvent.VK_BACK_SPACE 오류 관련. Key Event 발생시 아래와 같은 순서로 호출이 된다. Key Pressed(..) ▶ Key Typed(...) ▶ Key Released(..) 이때!!! 백스페이스키를 눌렀을 경우 각 메소드에서 인식하는 Key Code는 어떨까?? Key Pressed(..) : 8번. Key Typed(...) : 0번. 2019. 7. 9.
getClass().getResource("/data/head.dat") vs getClass().getResourceAsStream("/data/head.dat") getClass().getResource("/data/head.dat") vs getClass().getResourceAsStream("/data/head.dat") jar 파일에 묶여 있는 것이 아닌 디렉토리에서 파일을 읽을 경우. ▶ getClass().getResource("/data/head.dat") File file = new File(getClass().getResource("/data/head.dat").getPath()); BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(file))); StringBuffer result = new StringBuffer(); String tmp = r.. 2019. 7. 9.
[Java] JTable 입력시 Cell의 값이 유실(?)되는 것을 막으려면? [Java] JTable 입력시 Cell의 값이 유실(?)되는 것을 막으려면? Java의 Swing 컴포넌트중 JTable의 Cell 값을 입력하는 도중 Table의 최종값을 DB 혹은 Repository에 저장하기 위한 액션으로 "OK"버튼을 클릭하여 JTable의 값을 취하고자 할때 Editing 중이던 Cell의 값을 얻지 못하는 에러가 발생한다. 이런 경우 어찌해야할까?? JTale의 clearSelection()... 등등의 명령을 사용해도 소용 없다. 이럴 경우 editCellAt(-1, -1) 명령을 먼저 내린 후 JTable의 값을 취하도록하면 문제 해결. 해당 작업은 try로 묶어준다. 아래와 같은 방식으로... try { ipcSetTable.editCellAt(-1, -1); } ca.. 2019. 7. 9.
RMI 서버/Client 실행시 UnmarshalException 발생 해결 방법 RMI 서버/Client 실행시 UnmarshalException 발생 해결 방법 RMI Server 프로그램을 작성 후 Server 실행시 아래와 같은 에러가 발생 java.rmi.ServerException: RemoteException occurred in server thread; nested exception is: java.rmi.UnmarshalException: error unmarshalling arguments; nested excep tion is: java.lang.ClassNotFoundException: Stub클래스파일_Stub ◀◀◀ 자신의 클래스 파일에 따라 다를 수 있음. 위와 같은 에러가 발생했다면 1. 우선적으로 점검 할 것이 RMI시 사용할 Interface를 이용하.. 2019. 6. 17.
728x90