Posted by À±°æ±¸ on September 19, 1997 at 17:43:26:
In Reply to: [Q]JDK1.0¿¡¼ JDK1.1·ÎÀÇ º¯È¯ posted by ¹ÚÁ¾¼® on September 19, 1997 at 00:02:49:
¸ÕÀú
str_byte = new byte[str_len];
comment = new String(str_byte, 0);
À§¿¡¼ 0Àº º°·Î Àǹ̰¡ ¾ø½À´Ï´Ù.
¿ø·¡ hi byte¸¦ ¼³Á¤ÇÏ´Â °ÍÀε¥ À¯´ÏÄڵ尡 »óÀ§ ¹ÙÀÌÆ®¸¦ º°µµ·Î ¼³Á¤ÇÏ´Â
ÀÌ»óÇÑ ¹æ¹ýÀ¸·Î ¸¸µé ÀÌÀ¯°¡ ÀÖÀ»±î¿ä?
¾î·µç 0À̹ǷΠ°£´ÜÇÏ°Ô
str_byte = new byte[str_len];
comment = new String(str_byte);
À¸·Î ÇÏ¸é µË´Ï´Ù.
¸¶¿ì½º À̺¥Æ®(java.awt.event.MouseEvent)¿¡´Â translateÀÇ ÀÚ¹Ù 1.1 ¹öÀüÀÎ
translatePoint ¸Þ¼Òµå°¡ ÀÖ½À´Ï´Ù.
¾Æ¸¶µµ ±âÁ¸ÀÇ handleEvent´Â ¸¶¿ì½º À̺¥Æ®¿´°ÚÁö¿ä?
MouseMotion À̺¥Æ®¸¦ ¹Þ±â À§ÇØ ¸ÕÀú Ŭ·¡½º°¡
MouseListener¿Í MouseMotionListener ÀÎÅÍÆäÀ̽º¸¦ ±¸ÇöÇÏ°í
Àû´çÇÑ °÷¿¡¼ addMouseListener¿Í addMouseMotionListener ¸Þ¼Òµå È£ÃâÀ» ÇÏ¿©
¸®½º³Ê µî·ÏÀ» ÇÑ ÈÄ
¾Æ·¡¿Í °°ÀÌ ÀÎÅÍÆäÀ̽º ¸Þ¼Òµå¸¦ ±¸ÇöÇÏ¿© ¿øÇÏ´Â °ÍÀ» ¼öÇàÇÒ ¼ö ÀÖ½À´Ï´Ù.
private void redispatch(MouseEvent e) {
Point origin = e.getComponent().getLocation();
e.translatePoint(origin.x, origin.y);
e.getComponent().getParent().dispatchEvent(e);
}
public void mouseMoved(MouseEvent e) { redispatch(e); }
public void mouseDragged(MouseEvent e) { redispatch(e); }
public void mouseClicked(MouseEvent e) { redispatch(e); }