Display an Image in a New Dialog When a User Enters a Keyword
I am working on a Java Swing application where I want to display an image in a separate dialog when a user enters a specific keyword in a form.
Here’s what I have so far:
A JDialog for the form, with a JTextField where users can input a city name and a button to confirm.
I want the program to check if the input matches a predefined keyword (e.g., 'Barcelona')
If the keyword matches, it should open another JDialog displaying an image of that city (e.g., 'barcelona.jpg')
Any help would be greatly appreciated!!
5 Replies
⌛
This post has been reserved for your question.
Hey @hane127! Please useTIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here./close
or theClose Post
button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.
What about that is the issue?
Honestly, I´m unsure how to do it since it´s my first time working with Java Swing . I´ve been looking for resources but none of them has helped me to do it the way I want 😢
Do you have issues with entering a keyword, loading the image, displaying it or something else?
💤
Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping
.
Warning: abusing this will result in moderative actions taken against you.