Computer/Java2012/02/07 09:10
Mac OS X은 기본적으로 자바가 설치 되어 있다. 
다음 과 같은 경로에 설치가 되어 있다.
/System/Library/Frameworks/JavaVM.framework/Versions/Current
하지만 자바 소스 인 src.jar 및 doc.jar는 없는데 이것 은 Java for Mac OS X 10.x Update x Developer Package를 별도로 설치해야 하고 애플 사이트에 계정이 있어야 다운로드를 할 수 있다.

여기서 Java Developer Package 를 검색하여 다운 받자. Apple Developer Downloads Website

설치를 하면 다음과 같은 경로에서 해당 파일들을 찾을 수 있다.
/Library/Java/JavaVirtualMachines/1.6.0_29-b11-402.jdk/Contents/Home

그리고 해당 IDE에서 소스 연결을 하면 쉽게 소스를 참조할 수 있다. 

 
저작자 표시 비영리 변경 금지
Posted by Bitaholic ...Simple is beautiful Bitaholic
Computer/Java2009/03/20 08:48
Applet에서 특정한 권한이 필요할 때 예를 들어 로컬 파일 읽기 쓰기 등 해당 Applet 에 개인키로 사인을 해야 한다. 이 과정이 applet 클래스를 jar로 압축하고 jarsigner로 사인을 해야 하고 이 jar파일을 웹어플리케이션 폴더로 옮겨야 한다. 이 번거로운 과정을 ant로 빌드 파일을 만들어 놓으면 쉽게 자동화를 할수 있다. 물론 이작업을 하기 전에 keytool로 키셋을 만들어 놓아야 한다.
<target name="all" depends="jar, jarsign, movejar"/>
<target name="jar">
<jar destfile="myapplet.jar" basedir="bin"/>
</target>
<target name="jarsign">
<signjar jar="myapplet.jar" alias="mykeyalias" storepass="changeit" verbose="true"/>
</target>
<target name="movejar">
<move overwrite="true" todir="c:/webapp/">
<fileset dir="." id="id">
<include name="myapplet.jar"/>
</fileset>
</move>
</target>
</project>


저작자 표시 비영리 변경 금지
Posted by Bitaholic ...Simple is beautiful Bitaholic
TAG Ant, applet, Java, Sign
Computer/Java2007/08/29 18:42
class Integer
   static String toBinaryString(int i)
   static String toHexString(int i)
   static String toOctal(int i)

위의 메소드를 사용하면 손쉽게 변환을 할 수 있다...

== example ==
String hexResult = Integer.toHexString(15);
String binaryResult = Integer.toBinaryString(15);
String octalResult = Integer.toOctal(15);
System.out.println("hexResult = " + hexResult);
System.out.println("binaryResult = " + binaryResult);
System.out.println("octalResult = " + octalResult);
.
.
결과
hexResult = f
binaryResult = 1111
octalResult = 17



Posted by Bitaholic ...Simple is beautiful Bitaholic
TAG API, Java, 진수
Computer/Java2006/12/16 03:53

둘다 java application을 실행 시켜주는 실행 파일이다.

 

틀린점은 javaw로 자바 어플리케이션을 실행시 콘솔이 뜨지 않는다는 점.. 따라서 -version같은 옵션으로 javaw 버전 같은 정보도 볼수 없다. 또한 java로 띄운 콘솔을 닫으면 해당 자바 어플리케이션도 같이 종료되지만, javaws는 별개로 콘솔을 닫아도 자바어플리케이션으 종료가 되지 않는다.

Posted by Bitaholic ...Simple is beautiful Bitaholic
Computer/Java2006/11/17 20:55

이클립스로 자바 프로젝트를 만들어 사용할 때.. 옵션을 주어

 

소스 디렉토리랑 바이너리 디렉토리로 나눌 수 있다.

 

처음 프로젝트를 생성하면 아래와 같이 기본적인 폴더 2개와 프로젝트 파일, 클래스패스 파일이 생긴다.

 


사용자 삽입 이미지
 
예를 들어
 
이미지를 읽어들여 패널의 배경으로 쓰는 간단한 예제를 만들었을 때
 
이미지는 images라는 폴더에 넣어서 imaages폴더를 src밑에 소스들과 같이 두고
 
아래와 같이
 
ImagePanel panel = new ImagePanel(new ImageIcon("image/background.png").getImage));
 
상대경로를 적으면 절대로 이미지를 읽어오지 못한다.
 
왜냐하면 project 의 기본경로가 project파일이 있는 폴더 이기 때문이다.
 
소스가 있는 곳이 절대 아니다.
 
따라서 images폴더는 src폴더가 아닌 project root폴더에 넣어야 한다.
 

사용자 삽입 이미지
간단한 거지만 모르고 있으면 왜 이미지가 안뜨는지 한참 고민해야 한다
 
나처럼 ㅠㅠ
 
Posted by Bitaholic ...Simple is beautiful Bitaholic
TAG Eclipse, Java
Computer/Java2006/11/17 20:40
import java.io.File; public class CurrentDir {   public static void main (String args[]) {File dir1 = new File (".");     File dir2 = new File ("..");try {       System.out.println ("Current dir : " +dir1.getCanonicalPath());       System.out.println ("Parent  dir : " +dir2.getCanonicalPath());       }     catch(Exception e) {       e.printStackTrace();       }     } }
Posted by Bitaholic ...Simple is beautiful Bitaholic
TAG IO, Java
Computer/Java2006/11/03 03:04

Scott Violet 이사람을 swing소스를 보다 보면 종종 볼수 있다.

 

요즘 스윙 텍스트 소스를 보는데 윽 머리가 깨질거 같다 ㅎㅎㅎㅎ

 

sun 사이트에 이사람이랑 인터뷰한 글이 있길래 좀 읽어봐야지~

 

Meet Scott Violet, Architect for the Swing Toolkit Team at Sun Microsystems

 

요즘 원서를 좀 봐서 영어가 잘 읽히는거 같은데 아직도 원서 볼렴 한숨만 나온다 ㅎㅎㅎㅎ

 

언제쯤 편히편히 볼수 있을랑가 ㅎㅎㅎ

Posted by Bitaholic ...Simple is beautiful Bitaholic
TAG Java, Swing
Computer/Java2006/10/22 07:28

Swing에서 쓰이는 Thread에 대해서 알아보자

 

Threads and Swing

 

Posted by Bitaholic ...Simple is beautiful Bitaholic
TAG Java, Swing, thread
Computer/Java2006/10/20 03:30

painting 이 절실히 필요하다~

 

Performing Custom Painting

 

 

Posted by Bitaholic ...Simple is beautiful Bitaholic
TAG Java, pating
Computer/Java2006/10/09 20:05
Posted by Bitaholic ...Simple is beautiful Bitaholic
TAG Java, Java5