I am developing a simple game where have to write words. So I taught to make a TextArea where the words typed goes, to this I need a scroll to can see all words. But i have a render method that have this:
public void onRender(Graphics2D g) {
g.drawImage(imgBG, 0,0, null); //draws my background
g.setColor(Color.WHITE);
g.setFont(titulo);
g.drawString("Type the Word!", 260, 240);
g.setColor(Color.darkGray);
for(int i=0;i < wordFind.length();i++)
{
g.fillRect(inicioTraco+(60*i),yTraco,40,10);
}
if(tag_s == true)
{
tag_s = false;
g.setFont(titulo);
g.drawString("s",posicao, 100);
}
this.getMainWindow().add(new JTextArea("Test",10,20));
}
getMainWindow is a method that return my main JFrame, and i put this JTextArea to show the words.
But it is not appearing in my game.
I taught to make a white rect (fillrect) but it will not have scoll.
So I don't know what to do. Can someone clear my mind?
thanks.