this.add(pressbutton); } public void paint(Graphics g) { g.drawString("this is the first string. \n this is the second string.",20,90); g.drawString(" this is the second string.",20,110); } } 可完成。
g.drawString("this is the first string."+" \n"+" this is the second string.",20,90);
public void init()
{
Button pressbutton=new Button("press");
pressbutton.setBackground(Color.yellow);
TextField textme=new TextField(50);
textme.setBackground(Color.orange);
textme.setEditable(true);
textme.setVisible(true);
//textme.requestFocus();
this.add(textme);
this.add(pressbutton);
}
public void paint(Graphics g)
{
g.drawString("this is the first string. \n this is the second string.",20,90);
g.drawString(" this is the second string.",20,110);
}
}
可完成。
string.",20,90);
我用你的方法,但还是不能达到换行的目的,请问有其他办法吗?
位置。