This application allows users to play audio files and display corresponding images using Java Swing. It provides buttons to select different songs and displays the album covers of each song.
The source file is named songs.kt.
Run the source file in your selected IDE, then press the buttons for the songs you would like to hear. Buttons are labeled by the song name, and upon pressing said button, the song will start to play, and the song's album image will be displayed as well.
The application can be run to play audio files and display images. Users can click on buttons representing different songs to play them and see the corresponding images.
The main() function is the entry point of the application. It invokes the createAndShowGUI() function to initialize
and display the GUI.
This function creates the main frame and panel for the GUI. It initializes buttons for different songs and adds action
listeners to handle button clicks. The changeImage() function is called to display the corresponding image when a
button is clicked.
This function changes the displayed image based on the button clicked. It removes the previous image (if any) from the panel and adds the new image corresponding to the selected song.
This function is called when a button representing a song is clicked. It sets the clicked variable to the name of
the clicked button.
The "Stop Music" button allows users to stop the playback of the currently playing audio file.
- Song and image files are expected to be located in the
srcdirectory. - Song and image file urls should not be changed within source file.