RPG Style Dialogue Boxes?

Hi all! I’m new here as you can probable tell, but a website dedicated to Java game development? How did I not know sooner?

Anyway, I’m working on a project for class, I’m just trying to make a small “game” akin to the Megaman Battle Network franchise. “Game” because it’s not a full game, just a single room where the player character can interact with some items around the room. There’s no object to it, just a sort of demo, I guess?

So I haven’t actually programmed Java in a while, it was ages ago I learned any Java in high school. I remember enough to be able to make small little simple things, but a full blown game wasn’t ever anything I learned how to do (though I did try to brute force once for my final project back then).

I’ve been following this guide from for the basic framework. I figured my game just needed to be a restriced sized space where the character could move about and certain locations on the screen would turn up a dialogue box with dialogue on screen. That’s all I need to make, really, but the dialogue box is the issue.

I’m not exactly sure where this code should be added (I’m thinking to the Board class? I’m not 100% sure.) But I have graphics for the dialogue box and a vague idea of what the dialogues would be. I don’t think I can totally use the code in the site, since the only text that appears shows on screen and never goes away, where a dialogue box text would only need to appear when it is called by a keyboard action and disappear after all the text has been shown on screen.

Browsing through the website I found a thread that had info on text wrapping inside of a specified set of boundaries, but I’m still not sure how to make the whole thing work. It’s the last bit of coding I need to do to finish all the code for the project, so I just need to get it working and I’ll be pretty much done (I think!).

For what it’s worth, I’ve altered the code so that the “aliens” class is just a class that adds a space (defined by the image added into it) that the character can interract with when enter is pressed and doesn’t move around. Am I barking up the wrong tree? Do I need to start from scratch again? Or is it just a little bit further away? Can anyone give me any idea about where to start next?

Thanks in advance!