프로그램312 [Eclipse] 이클립스 기본 글꼴을 변경해서 한글을 잘 보이도록 하자 이클립스를 설치하면 기본 글꼴로 Consolas 글꼴이 선택되어 있다. 이 글꼴은 한글이 매우 작게 보여서 내용을 확인하는데 무척 어려움이 있다. 그래서 이 글꼴을 한글이 잘 보이는 글꼴로 변경해 보자. 사람마다 자기 취향에 맞는 글꼴이 있겠지만, Courier New 글꼴이 한그도 잘 보이고 Fixed Font 여서 글자 가로 크기가 동일해서 코딩 시에 편리하다. 1. 'Window>Preferences' 메뉴를 선택해서 'Preferences' 창을 띄운다. 2. 좌측 트리에서 'General>Appearance>Colors and Fonts' 를 선택한다. 'Colors and Fonts' 에서 'Text Font' 를 선택한 후에 'Edit...' 버튼을 클릭해서 글꼴 선택 창을 띄운다. 3. '.. 2014. 2. 13. [iBatis] sql문에 한글 추가시, 한글 깨짐현상 Charset charset = Charset.forName(“UTF-8″); Resources.setCharset(charset); Reader reader = Resources.getResourceAsReader(“SqlMapConfig.xml”); SqlMapClient sqlMap = SqlMapClientBuilder.buildSqlMapClient(reader); reader.close(); 2014. 2. 12. [Log4j] Log4j 설정 Reference 1. Priorities 로깅 레벨은 다음과 같다. DEBUG > INFO > WARN < ERROR < FATAL Level Description ALL Output of all messages TRACE Detailed Debugging DEBUG Debugging (Method xy called with param abc …) INFO General information (Program started/ended, connected to host foo, calculation took n seconds) WARN Unexpected situation ERROR Error (Exception caught) FATAL Critical error, program stops OFF Logging is dea.. 2014. 2. 11. java.text.SimpleDateFormat SimpleDateFormat을 이용하면 현재 날짜 및 시간을 원하는 포맷으로 가져올 수 있다. … Format 기호 의미 보기 G 연대(BC, AD) AD y 년도 2009 M 월(1~12월 또는 1월~12월) 10또는 10월, OCT w 년의 몇 번째 주(1~53) 50 W 월의 몇 번째 주(1~5) 4 D 년의 몇 번재 일(1~366) 100 d 월의 몇 번째 일(1~31) 15 F 월의 몇 번째 요일(1~5) 1 E 요일 월 a 오전/오후(AM, PM) PM H 시간(0~23) 20 k 시간(1~24) 12 K 시간(0~11) 10 h 시간(1~12) 11 m 분(0~59) 35 s 초(0~59) 55 S 천분의 1초(0~999) 253 z Time zone(General time zone) GM.. 2014. 2. 10. java.util.ResourceBundle java에서 사용되는 properties 파일의 내용을 읽어올수 있다. ResourceBundle클래스는 국제화를 지원하기 Locale 파일 규칙을 이용해서 파일명을 사용할 수 있다. properties 파일은 getBundle 메소드에 의해 객체로 전환이 된다. 따라서,크랠스 파일과 같이 위치를 추적할 수 있다. 만약 “server.properties” 라는 파일이 classes 폴더 밑에 conf 라는 폴더 아래 있다면 “conf.server.properties” 로 해서 찾을 수 있다. 위치 : web-inf/classes/conf/server.properties ResourceBundle bundle = ResourceBundle.getBundle(“conf.server.properties”); .. 2014. 2. 9. properties 파일을 읽어 들이고 저장하기 java.util.Properties 클래스를 사용하면 쉽게 키와 값으로 이루어진 properties 파일을 읽어들이고 작성할 수 있다. 1. properties 파일 작성 Properties prop = new Properties(); prop.setProperty(“SERVER_IP”, “127.0.0.1″); prop.setProperty(“SERVER_PORT”, “5000″); try{ OutputStream stream = new FileOutputStream(“파일명”); prop.store(stream, “Server Info”); stream.close(); } catch(IOException ex){ ex.printStackTrace(); } 2. properties 파일 읽어들이기 P.. 2014. 2. 8. Access restriction: The type Resource is not accessible due to restriction on required library jdk 1.5 를 사용해서 스프링의 애노테이션을 사용하다가 jdk 1.6을 사용하면서 에러가 발생했다. import javax.annotation.Resource; 위 부분이 1.6에서는 “Access restriction: The type Resource is not accessible due to restriction on required library” 에러가 발생한다. 이 에러를 제거하는 방법은 다음과 같다. Window>Preferences>Java>Compiler>Errors/Warnings 을 선택한 후에, 우측 “Deprecated and restricted API 를 선택해서 열린 하위메뉴에서 “Forbidden reference(access rules) 를 “Error” 에서 “Warn.. 2014. 2. 7. 이전 1 ··· 25 26 27 28 29 30 31 ··· 45 다음