So i want to get a game that i'm making to start playing music when i open it. i have never done anything like this before, so i was wondering on some advice. i couldnt find any comprehensible things online, considering im a noob, so if you could do this and explain it pretty well that would be amazing. thanks! oh, i can post any info you need on the program.
the main class looks like:
package com.game.main.window;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import java.awt.event.ActionListener;
public abstract class Main extends JFrame implements ActionListener {
public static JFrame frame = new JFrame();
public static void main(String[] args) {
createWindow();
}
public static void createWindow() {
ImagePanel panel = new ImagePanel(
new ImageIcon(
"C:\\Users\\Austin\\Pictures\\My Pictures\\Le Parkour\\ABC0001.jpg")
.getImage());
frame.getContentPane().add(panel);
frame.setJMenuBar(MenuBar.menuBarCreator());
frame.pack();
frame.setTitle("*Game Title* Beta 0.0.1 ADMINISTRATOR VERSION");
frame.setSize(ImagePanel.img.getWidth(null),
ImagePanel.img.getHeight(null));
frame.setLocation(100, 100);
frame.setVisible(true);
frame.setResizable(false);
frame.setDefaultCloseOperation(EXIT_ON_CLOSE);
}
}