I have a program that I made for my Spanish teacher and I want to make the dock/taskbar have an icon. I have an attempt here, but it doesn't work.
package com.jaketherey;
import java.awt.Color;
import java.net.URL;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.SwingUtilities;
public class Inglés_Switcher {
public static void main(String[] args) {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
JFrame frame = new switcherContent();
frame.setVisible(true);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(950, 850);
frame.setResizable(false);
frame.setLocationRelativeTo(null);
frame.setTitle("Inglés Switcher by Jacob Batista");
frame.getContentPane().setBackground(Color.GREEN);
//Attempt to Add Icon, Remember I want it for both Mac and Windows
ImageIcon icon = new ImageIcon("/com/jaketherey/ñ.png");
frame.setIconImage(icon.getImage());
}
});
}
}
If you need the JFrame it uses for the content then I will give it to you but I didn't think it was important for the problem...
Help? Thanks.