I've tried countless tutorials and looked at countless websites (including stack overflow) but none of the code had worked for me. So I've ended up asking my own question, what is wrong with my code?
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
import java.io.IOException;
import javax.imageio.ImageIO;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JMenuBar;
import javax.swing.JPanel;
public class titlescreen extends JFrame {
/**
*
*/
private static final long serialVersionUID = 1L;
JPanel jp = new JPanel();
JButton jb = new JButton();
public titlescreen() throws IOException {
JFrame f = new JFrame("MacroDom");
//keep everything working
f.setTitle("Don't Read Me :P");
f.setSize(5000, 5000);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setVisible(true);
jb.setIcon(new ImageIcon("button.png"));
jp.add(jb);
add(jp);
validate();
}
public static void main(String[] args) throws IOException {
titlescreen ts = new titlescreen();
}
}