±Û¾´ÀÌ :À±Áö¼ö 1998³â 9¿ù 09ÀÏ 02:21:50
In Reply to: [Q]½ºÅ©·Ñ¹Ù¿¡¼... posted by À̱¤¼ö on 1998³â 8¿ù 31ÀÏ 11:57:05:
½ºÅ©·Ñ ¹Ù¿¡¼ ¹ØÀ¸·Î ³»¸®´Â ÁÂÇ¥ ¸¸Å ĵ¹ö½ºÀÇ À̹ÌÁöµéÀ» Á»´õÀ§·Î ¸®ÆäÀÎÆ® Çϸé
µÇ´Â °É·Î ¾Ë°í ÀÖ¾î¿ä Âü Àü¿¡ ÀÖ´Â À̹ÌÁö´Â Áö¿ì°í¿ä..
±×¸®·Î ±õ¹Ú°Å¸®´Â°Ç Àüü¸¦ Áö¿ì°í ´Ù½Ã Ä¥ÇÏ´Â°Ô ¾Æ´Ï¶ó À̹ÌÁö°¡ ÀÖ´Â ºÎºÐ¸¸ Áö¿ì°í Ä¥ÇÏ¸é µÇ°í¿ä.
´Ù¸¥ ¹æ¹ýµµ ÀÖ°ÚÁö¸¸ À̹æ¹ýµµ ÁÁÀº ¹æ¹ý °°¾Æ¿ä..
´ÙÀ½Àº Àü¿¡ Á¦°¡ Çغ¸¾Ò´ø ¼Ò½ºÀε¥..
¾î¶»°Ô Çß´ÂÁö Àß ±â¾ïÀÌ ¾È³ª¿¡¿ä..
¿Í ÀÌÁ¦ ´Ù Çß´Ù.
import java.awt.*;
import java.applet.Applet;
// Class hot
public class hot extends Applet
{
final int MenuBarHeight = 0;
public Scrollbar ScrollBar1;
public Image img[];
public boolean suc=false;
public int plusheight,pluswidth;
public static Image currentimage;
public Graphics g;
public void init()
{
setForeground(Color.black);
setBackground(Color.black);
setFont(new Font("Dialog",Font.BOLD,12));
setLayout(null);
g=this.getGraphics();
ScrollBar1 = new Scrollbar(Scrollbar.VERTICAL);
ScrollBar1.setValues(0,22,0,550);
ScrollBar1.setBackground(Color.lightGray);
img=new Image[5];
String strImage;
int i;
try {
for(i=0;i<5;i++)
{
strImage="t"+i+".gif";
img[i]=getImage(getCodeBase(),strImage);
}
} catch(Exception e) {System.out.println(e.toString());}
imagepaint();
add(ScrollBar1);
plusheight=27;
pluswidth=443;
InitialPositionSet();
}
public void imagepaint()
{
// ÁöÁ¤µÈ ºÎºÐ¸¸ Ä¥ÇÏ°Ô ÇÏ´Â ºÎºÐ
g.clipRect(443,27,106,368);
g.setColor(Color.black);
g.fillRect(0,0,549,396);
int i; // paint()
for(i=0;i<5;i++) {
g.drawImage(img[i],pluswidth,plusheight,100,100, this);
plusheight=plusheight+120;
}
}
public void paint(Graphics g)
{
}
public void InitialPositionSet()
{
// InitialPositionSet()
resize(549,396);
ScrollBar1.reshape(418,6+MenuBarHeight,15,373);
// End of InitialPositionSet()
}
public boolean handleEvent(Event e)
{
switch(e.id) {
case Event.MOUSE_DRAG:
hot_mouseDrag(e.target, e.x, e.y, e.modifiers);
break;
case Event.MOUSE_DOWN:
hot_mouseDown(e.target, e.x, e.y, e.modifiers, e.clickCount);
break;
case Event.SCROLL_ABSOLUTE:
case Event.SCROLL_LINE_DOWN:
case Event.SCROLL_LINE_UP:
case Event.SCROLL_PAGE_DOWN:
case Event.SCROLL_PAGE_UP:
plusheight=-((Scrollbar)e.target).getValue();
imagepaint();
break;
}
return super.handleEvent(e);
}
public void hot_mouseDrag(Object target, int x, int y, int modifiers)
{
g.clipRect(0,0,450,396);
g.setColor(Color.black);
g.fillRect(0,0,549,396);
g.drawImage(currentimage,x,y,this);
}
public void hot_mouseDown(Object target, int x, int y, int modifiers,int clickCount)
{
currentimage=(Image)target;
}
} // End of Class hot