I want to update a image with User input. I have the blank image (a box) as well as a method of acquiring user input. But I can't get the program to display the input from the user.
private String text = "";
public void updateImage()
{
GreenfootImage image = new GreenfootImage(boxImage);
GreenfootImage textImage = new GreenfootImage(text, 20, Color.BLACK,
transparent);
image.drawImage(textImage, (image.getWidth()-textImage.getWidth())/2,
(image.getHeight() - textImage.getHeight())/2);
setImage(image);
}
public void UserInput()
{
boolean boxClick = Greenfoot.mouseClicked(this);
if(boxClick == true && this.isFull == false)
{
String key = Greenfoot.getKey();
String inputstring = JOptionPane.showInputDialog("Data:");
}
