https://github.com/msh-trojan/java_21_combo_box_test_1
This Java program uses a **JComboBox** to let users select and display different images. The images are shown in a **JLabel**, and an **ItemListener** updates the displayed image when a new one is selected from the dropdown. The GUI is created with **FlowLayout** and runs inside a **JFrame** window.
https://github.com/msh-trojan/java_21_combo_box_test_1
graphics gui-components java jcombobox jframe
Last synced: 9 months ago
JSON representation
This Java program uses a **JComboBox** to let users select and display different images. The images are shown in a **JLabel**, and an **ItemListener** updates the displayed image when a new one is selected from the dropdown. The GUI is created with **FlowLayout** and runs inside a **JFrame** window.
- Host: GitHub
- URL: https://github.com/msh-trojan/java_21_combo_box_test_1
- Owner: MSH-trojan
- Created: 2024-08-24T19:12:48.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-09-10T20:21:57.000Z (over 1 year ago)
- Last Synced: 2024-09-10T23:46:11.411Z (over 1 year ago)
- Topics: graphics, gui-components, java, jcombobox, jframe
- Language: Java
- Homepage:
- Size: 142 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Java_21_Combo_Button_Test_1
## Overview:
This Java program uses a JComboBox to let users select and display images in a simple GUI. The image updates automatically based on the selection.
How to Run:
Save the code as ComboBoxTest.java and ensure the image files (bug1.gif, bug2.gif, travelbug.gif, buganim.gif) are in the same directory.
Compile: javac ComboBoxTest.java
Run: java ComboBoxTest