Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package tictactoe;
- import java.net.URL;
- import javax.swing.ImageIcon;
- import javax.swing.JFrame;
- import javax.swing.UIManager;
- import javax.swing.UnsupportedLookAndFeelException;
- public class Main {
- public static ImageIcon getImageIcon(String filename) {
- ImageIcon icon = null;
- URL url = Main.class.getResource(filename);
- if (url != null) {
- System.out.println("getImageicon: url=" + url);
- icon = new ImageIcon(url);
- System.out.println("getImageicon: image=" + icon.getImage());
- } else {
- System.out.println("getImageicon: url=null");
- }
- return icon;
- }
- public static void main(String[] args) throws ClassNotFoundException, InstantiationException, IllegalAccessException, UnsupportedLookAndFeelException {
- UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
- Board board = new Board();
- JFrame frame1 = new JFrame("Board");
- frame1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- frame1.add(board);
- frame1.pack();
- frame1.setVisible(true);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement