Java isn’t a bad way to go, to be honest, but it really depends on what you want to learn and what you want to achieve. My own project Yaffaif is built in Java using the JavaFX GUI components, and all done in NetBeans. I chose JavaFX because I wanted to learn it, it looks more modern than Swing (eg. FetshMaster), and it is more performant, as it doesn’t try to do all the rendering in Java, throwing some of it to native libraries. Also it supports HTML and CSS. Lilith’s Throne is an example of a Java/JavaFX game that only really uses a single HTML component and works by changing the DOM.
However, what you aren’t getting is a text game engine, so you have to roll your own - which is non-trivial (but an interesting development challenge). There’s DayDreamer which is a Java/Swing based text-adventure engine, so you might want to look at that too.
If you want to hone some of your web-dev experience, then you might want to look at Twine. It will get you started quickly, but once you move beyond the trivial you will be flexing HTML, CSS and JavaScript know-how.
Also, think about what kind of text-adventure you want. Is it all point and click, or do you need the classical experience that reacts to textual input? If it’s the latter then making a good text input parser is another coding challenge. Tools like Inform and TADS have this covered, but at the expense of making mouse input harder.
RenPy, which has it’s own scripting, backed by Python, is another option. It’s usually associated with Visual Novel style games, but can be put into a text mode.
Then there’s 2D/3D game engines - these tend to not be so text focused, so present more of a challenge with simple things like a scrollable text box, and the inevitable text substitutions you’ll need for a text focused game.
Like any development choice it has to be informed by what you know and what you want to learn.