2006.09.15 Friday | 11:59

  Java ²èÌ̹½À®¥Õ¥¡¥¤¥ë ¤Õ¤ë¤¤¤à¤«¤·

// *********************************************
// ¥á¥Ë¥å¡¼( 2 ) ¤Î½èÍý
// ¿·¤·¤¤ÆâÉô¥á¥½¥Ã¥É
// 2006/09/14
// ¥Æ¥­¥¹¥È¥Õ¥¡¥¤¥ë½èÍý
// *********************************************
void Action_File() {
	// ­¡ ¥«¥ì¥ó¥È¥Ç¥£¥ì¥¯¥È¥ê¼èÆÀ
	String sPath = (new File("")).getAbsolutePath() + "\\";
	Me.MsgOk( sPath );
	sPath += "conf.txt";

	// ­¢ ¥Æ¥­¥¹¥È¥Õ¥¡¥¤¥ë¤òÆɤ߹þ¤ß
	String line = null;
	String st = null;
	int x = 0;
	int y = 0;
	try {

		BufferedReader inFile = new BufferedReader( new FileReader( sPath ) );

		while ( ( line = inFile.readLine() ) != null) {

			// ¥æ¡¼¥¶´Ø¿ô¤Ç¡¢Æ¬1¥Ð¥¤¥È¤ò¼èÆÀ
			st = uf.substr( line, 0, 1 );
			if ( st.equalsIgnoreCase( ";" ) ) {
				// ¹Ô¤ÎÀèƬ¤¬¥»¥ß¥³¥í¥ó¤Ê¤é¤Ð¡¢ÆɤßÈô¤Ð¤·
				continue;
			}
			// ¥æ¡¼¥¶´Ø¿ô¤Ç¡¢Æ¬5¥Ð¥¤¥È¤ò¼èÆÀ
			st = uf.substr( line, 0, 5 );
			if ( st.equalsIgnoreCase( "Title" ) ) {
				// ÀèƬ¤¬Title ¤Ê¤é¤Ð¡¢Title=¥Ç¡¼¥¿ ¤Î¥Ç¡¼¥¿¤ò¼èÆÀ
				st = line.substring( 6 );
				// ¼èÆÀ¤·¤¿¥Ç¡¼¥¿¤ò¥¦¥¤¥ó¥É¥¦¤Î¥¿¥¤¥È¥ëʸ»úÎó¤È¤¹¤ë
				Me.setTitle(st);
			}
			if ( st.equalsIgnoreCase( "SizeX" ) ) {
				st = line.substring( 6 );
				x = Integer.parseInt(st);
			}
			if ( st.equalsIgnoreCase( "SizeY" ) ) {
				st = line.substring( 6 );
				y = Integer.parseInt(st);
			}
			System.out.println( line );
		}

		inFile.close();

	}
	catch ( Exception e ) {
		System.out.println( "¥Õ¥¡¥¤¥ë¥¨¥é¡¼" );
		System.out.println( e.getMessage() );
	}

	if ( x != 0 && y != 0 ) {
		Me.setSize(x,y);
	}

}