±Û¾´ÀÌ :¼À±¼® 2000³â 3¿ù 17ÀÏ 13:02:23
In Reply to: [Q] TextArea¿¡¼ ÁÙ¸¶´Ù »ö±òº¯È¯ÀÌ ¾ÈµÈ´Ù¸é.... posted by ÃÖ³²¼± on 2000³â 3¿ù 14ÀÏ 03:35:51:
äÆÃÀ» ¸¸µé·Á±¸ ÇϽô °ÍÀΰ¡¿ä?
Àú °°Àº °æ¿ì´Â ĵ¹ö½º¸¦ ºÙ¿©¼ °Å±â¿¡¼
public void paint(Graphics g){
int y=280;
g.drawImage(bg,50,0,this);
for(int i= msgVC.size()-1;i>=0;i--){
// System.out.println(n);
msg=(String)msgVC.elementAt(i);
StringTokenizer s = new StringTokenizer(msg,":",false);
String color = s.nextToken().trim();
String text = s.nextToken().trim();
// g.drawImage(tt,30,50,this);
// bg = getImage(s,"khj.jpg");
if(text==null)
text="";
else
{
if(color.equals("red"))
g.setColor(Color.red);
else if(color.equals("blue"))
g.setColor(Color.blue);
else if (color.equals("black"))
g.setColor(Color.black);
g.drawString(text, 10, y);
y -= 15;
}
}À¸·Î Çؼ
ĵ¹ö½º¿¡ »Ñ·Á ÁÖ¾ú°Åµç¿ä
±×¸®°í ½ºÀ®À¸·Î ÇÏ·Á¸é jtextpane ÀÌ¿ëÇÏ¸é µÇ°Åµç¿ä
¿øÇϽô ´äÀÌ µÇ¾ú´ÂÁö ¸ð¸£°Ú±º¿ä
¼ö°í Çϼ¼¿ä