±Û¾´ÀÌ :¾ÈÇöö 2000³â 6¿ù 01ÀÏ 15:08:50
In Reply to: List Box Å©±â¸¦ ¹Ù²Ù°í ½ÍÀºµ¥ posted by À¯¹Ì¿µ on 2000³â 5¿ù 31ÀÏ 16:19:20:
List class¸¦ ȸ鿡 »ðÀÔÇÒ ¶§
»ðÀÔÀ» À§ÇÑ List °´Ã¼ÀÇ preferred size¸¦ ¹°¾îº¾´Ï´Ù.
±×·±µ¥ ´äÀÌ ÇÑrowÀÇ ³ôÀÌ(pixel) * row¼ö ¸¸Å À̶ó±¸
¹ÝȯµÇ¾î ¹ö¸®±â ¶§¹®¿¡ Àß ¾È ¹Ù²î´õ¶ó±¸¿ä.
±×·¡¼ Ŭ·¡½º¸¦ Çϳª ¸¸µé¾ú´Âµ¥ ¾Æ¹« °Ë»çÁ¶°Ç ¾øÀÌ
´ëÃæ ¸¸µç°Å¶ó¼ À§ÇèÇÒÁöµµ ¸ð¸£´Ï±ñ ÂüÁ¶¸¸Çϼ¼¿ä.
µµ¿òÀÌ µÇ¸é ÁÁ°Ú³×¿©.
class MyList extends List {
int width = 0;
int height = 0;
public MyList(int row) {
super(row, false);
}
public void setSize(int x, int y) {
width = x;
height = y;
}
public Dimension preferredSize() {
return new Dimension(width, height);
}
}