이 블로그 검색

2010년 12월 23일 목요일

double에서 int로 변환

  • double->int

double transVal

(int)Math.round(transVal);


  • float->int
float transVal

Math.round(transVal );

2010년 12월 19일 일요일

TapPanel

TapPanel에서 주의 사항

HTML widget = new HTML("text");
add(widget, indextext);에서

추가한 widget을 차후에 수정하려면 widget.setHTML("modify"); 이렇게 해야 함.
widget=new HTML("modify");를 하면 widget가 새롭게 생성된 HTML 객체를 지시하게 되어
패널에 추가된 HTML객체는 지시하는 포인터(링크)가 없어진다.

StackOverflowError

StackOverflowError

이벤트가 무한대로 호출하기 때문에 나타날 수 있다.
예를 들면 onSelection핸들러에서 다시 select이벤트를 발생시키는 경우

2010년 12월 14일 화요일

팝업

http://whdrnr01.textcube.com/7

jquery플로그인

http://webjoy.kr/801

Calendar

cal.getTime ( )  : 캘린더에 해당하는 Date객체 return





    //공고일이 2010. 12. 03일 일 경우 만20세미만 날짜 가져오기 : 1990.12.04
    //  (1990.12.04이후 출생자)
    Calendar cal = Calendar.getInstance ( );
   //공고일로 설정
    cal.set(2010,12-1,03);
  
    cal.add ( Calendar.YEAR, -20 ); //20년 전....
    cal.add ( Calendar.DATE, +1 ); //1일 +
    String threeChildDate = new java.text.SimpleDateFormat("yyyy.MM.dd").format(cal.getTime());








현재날짜에서 2달전의 날짜를 구하기

Calendar cal = Calendar.getInstance ( );//오늘 날짜를 기준으루..
cal.add ( cal.MONTH, -2 ); //2개월 전....
System.out.println ( cal.get ( cal.YEAR ) );
System.out.println ( cal.get ( cal.MONTH ) + 1 );
System.out.println ( cal.get ( cal.DATE ) );





특정일을 입력받아 해당 월의 마지막 날짜를 구하는 간단한 예제.(달은 -1 해준다.)...윤달 30일 31일 알아오기.


Calendar cal = Calendar.getInstance ( );
cal.set ( Integer.parseInt ( args[0] ), Integer.parseInt ( args [1] ) - 1, Integer.parseInt ( args [2] ) );
SimpleDateFormat dFormat = new SimpleDateFormat ( "yyyy-MM-dd" );
System.out.println ( "입력 날짜 " + dFormat.format ( cal.getTime ( ) ) );
System.out.println ( "해당 월의 마지막 일자 : " + cal.getActualMaximum ( Calendar.DATE ) );

css

Hyperlink link = new Hyperlink("나의 유형 정보 보러가기","list");
link.addStyleName("linklink");

아래와 같이 됨.
즉, gwt-Hyperlink 뒤에 linklink가 붙는다.
------------------------------------------------------------
<div class="gwt-Hyperlink linklink"><a href="#list">나의 유형 정보 보러가기</a></div>
-------------------------------------------------------------


link.setStyleName("link");
하면

<div class="link">
로 됨

기존것 없애고

2010년 11월 26일 금요일

GWT 한글 깨짐 문제

이클립스- 편집-인코딩설정- 기타(other)를 체크-UTF-8을 선택하고 자바파일을 저장

2010년 11월 14일 일요일

웃으면서 일어나기

대부분의 사람은 인생을 살아가면서 무의미하게 하루하루를 보낸다.

사실 시간이란 나에게 주어진 선물이다. 신이 부모님이 나에게 준 기회인 것이다.

아침에 일어나서 눈뜨는 것이 너무나 설레여야 한다.

설레지 않는다는 것은 아무생각없이 살기 때문이다.



삶의 목표는 간단하다.

아침에 눈을 떴을때 즐거운 하루가 시작되었음에 입가에 웃음이 돌도록 하면 된다.

밤에 잘때 내일이 기다려지도록 하면 된다.


이 두가지만 실천하며 살면된다.

이 두가지만 이룩한다면 다른 모든것이 나에게 올것이다.

2010년 11월 5일 금요일

gwt 개발순서

Step 1: Creating a GWT Project


Step 2: Designing the Application


  • Examine the functional requirements.


  • Identify the elements of the UI design.




  • Step 3: Building the User Interface

    Step 4: Managing Events on the Client


  • Review the functional requirements.


  • Listen for events.


  • Respond to events.


  • Test event handling.





  • Step 5: Coding Functionality on the Client



    Step 7: Applying Style


    2010년 11월 1일 월요일

    choose

    <c:choose>
        <c:when test="${eterList.PROTECT_CD == '1'}">수급권자 </c:when>
        <c:when test="${eterList.PROTECT_CD == '4'}">국가유공자</c:when>
        <c:when test="${eterList.PROTECT_CD == '5'}">모부자가정</c:when>
        <c:when test="${eterList.PROTECT_CD == '6'}">위안부피해자</c:when>
        <c:when test="${eterList.PROTECT_CD == '7'}">65세이상직계존속부양</c:when>
        <c:when test="${eterList.PROTECT_CD == '8'}">장애인</c:when>
        <c:when test="${eterList.PROTECT_CD == '9'}">북한이탈주민</c:when>
        <c:when test="${eterList.PROTECT_CD == 'A'}">아동복지시설장추천</c:when>
       <c:otherwise>오류</c:otherwise>
    </c:choose>

    2010년 10월 28일 목요일

    according to TLD or attribute directive in tag file, attribute value does not accept any expressions

    "<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>" 으로 작성을 했더니 아래의 에러가 발생
    → According to TLD or attribute directive in tag file, attribute value does not accept any expressions

    "<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>"으로 수정하니 정상적으로 실행됨


    Servlet 2.3<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>

    Servlet 2.4<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>

    2010년 10월 21일 목요일

    jstl

    • forEach, if

    <select name="ASTimeHH">
        <c:forEach var="ii" begin="0" end="24" step="1">
    <option value="${ii}" <c:if test="${fn:substring(mainData.ACCEPT_START_YMD, 8, 10) == ii}">selected</c:if>>${ii}
            </option>
       </c:forEach>
    </select>

    이미지 넣기

    • 표기법
    1. background-image: url(images/bg.gif); =>css 파일 기준 경로
    2. background-image: url(../images/bg.gif);  => css 파일 기준 경로
    3. background-image: url(/images/bg.gif);

    • 반복 제어
    1. background-repeat : no-repeat;
    2. background-repeat : repeat;
    3. background-repeat : repeat-x;
    4. background-repeat : repeat-y;

    • 위치지정
    1. 가로(left, center, right), 세로(top, center, bottom)
    2. 예) background-position : left top;
    3. 예) background-position : 5px 8px;  =>오른쪽으로 5px, 아래로 8px
    4. 예) background-position : 50% 50%  =>화면 한가운데 배치
    5. 예) background-position : 5px 50%   =>오른쪽으로5px, 세로로 가운데

    • 제자리에 이미지 고정시키기
    1. background-attachment : fixed; =>스크롤해도 화면의 그 자리에 계속 유지
    2. background-attachment : scroll;  => 기본설정

    • 속기법
    1. background : url(image/bullseye.gif) fixed left top repeat-x;

    overflow 프로퍼티

    스타일 정의된 태그안의 내용물이 스타일에 정의된 너비나 높이를 넘어설 경우

    1. overflow : visible;  => 평소대로 보여준다.
    2. scroll;  => 스크롤바를 넣는다.
    3. auto; => 스크롤바가 필요할때만 넣는다.
    4. hidden; =>박스바깥으로 넘치는 내용은 숨긴다. 

    border태그

    • 속성
    1. color
    2. width : 선의 두께
    3. style : solid, dotted, dashed, double, groove, ridge, inset, outset, none, hidden

    • 설정방법
    1. border : 4px solid #F00;
    2. border-bottom : 2px dashed red;
    3. border : 2px inset #FFCC33; border-right:none;   =>위, 아래, 왼쪽에만 선을 넣음
    4. border-width:2px; border-style:double;  border-color:#FFCC33;

    2010년 10월 14일 목요일

    StringTokenizer

    st = new StringTokenizer(amcBean.getPOST(), "-");
    tmp_zip_1 = st.nextToken();
    tmp_zip_2 = st.nextToken();

    화면 가운데 배치하기

    #wrapper{
      width:760px;
      margin:15px auto 0 auto;
    }

    <body>
      <div id="wrapper">
      </div>
    </body>


    • 800*600정도 해상도에 맞음

    2010년 10월 13일 수요일

    XML 파일 생성

    1. JSP페이지에서 만들기
    2. JDOM
          -XML.JAVA

    /**
     * @class Xml
     * @brief Xml Classes
     *
     * registered date 20100105
     * programmed by Seok Kyun. Choi. 최석균
     * http://syaku.tistory.com
     */
    
    package org.syaku.util;
    
    import java.util.*;
    
    import org.jdom.*;
    import org.jdom.input.*;
    import org.jdom.output.*;
    
    
    public class Xml {
    
      // 해쉬맵을 이용하여 문서 생성
      public Document make(HashMap hm) throws Exception {
        
        Element data = new Element("data");
    
        Element element = new Element("item");
        Set set = hm.keySet();
        Object []items = set.toArray();
        for(int i = 0; i < items.length; i++) {
          String name = (String) items[i]; 
          String value = (String) hm.get(name);
    
          addElement(element,name,value);
        }
    
        data.addContent(element);
    
        Document document = new Document(data);
    
        return document;
      }
    
      // 엘리먼트 생성
      public Element addElement(Element parent, String name, String value) {
        Element element = new Element(name);
        element.setText(value);
        parent.addContent(element);
        return parent;
      }
    
      // 애트리뷰트 생성
      public void addAttribute(Element element, String name, String value){
        Attribute attribute = new Attribute(name,value);
        element.setAttribute(attribute);
      }
    
    
    }
    - XML출력
    <%@ page contentType="text/html; charset=euc-kr"%>
    <%@ page import="java.util.*" %>
    <%@ page import="org.syaku.util.*" %>
    <%@ page import="org.jdom.*" %>
    <%@ page import="org.jdom.output.*" %>
    
    <%
    HashMap hm = new HashMap();
    hm.put("샤쿠","Syaku");
    hm.put("Site","syaku.tistory.com");
    hm.put("블로그","Blog");
    
    Xml xml = new Xml();
    Document document = (Document) xml.make(hm);
    
    XMLOutputter outputter = new XMLOutputter();
    Format format = Format.getPrettyFormat();
    format.setEncoding("EUC-KR");
    outputter.setFormat(format);
    
    response.setContentType("application/xml");
    outputter.output(document, response.getWriter());
    // 시스템출력
    // outputter.output(document, System.out);
    %>
    


        - 생성된 XML

    3단 레이아웃

    <html>
    <head>
    <title>3단 레이아웃
    </title>

    <style type="text/css">
    #banner{
      background-color:red;
    }

    #leftSidebar{
      background-color:yellow;
      position:absolute;
      top:0;
      left:0;
      width:150px;
    }

    #mainContent{
      background-color:blue;
      margin-left:170px;
      margin-right:170px;
     
    }

    #rightSidebar{
      background-color:yellow;
      position:absolute;
      top:0;
      right:0;
      width:150px;
    }

    #footer{
      background-color:#808000;
    }

    #contentWrapper{
      position:relative;

    }
    </style>
    </head>
    <body>
    <div id="banner">banner</div>
    <div id="contentWrapper">
      <div id="leftSidebar">leftSidebar</div>
      <div id="mainContent">mainContent<br>여기는 본문영역입니다.</div>
      <div id="rightSidebar">rightSidebar</div>
      <div id="footer">footer</div>
    </div>
    </body>
    </html>