Link to java code, install the JDK, install IntelliJ or Eclipse (Recommending IntelliJ as I use that), and use the commands javac and java in command prompt to compile and run your programs. This is not a good tutorial, just telling you where to start. If you want a good tutorial, search up "Java setup tutorial" and find a good one. Heck, sometimes I even just use notepad for my coding, as long as you can afford it and like it, use it.
The java code in question: import java.awt.*; import javax.swing.*; import javax.swing.ImageIcon; import java.io.File; public class Graphjav extends JPanel { public static void main(String[] args) { SquarePanel panel = new SquarePanel(); JFrame frame = new JFrame("MemoryStor"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setSize(300, 300); // Add the panel to the frame frame.add(panel); String filePath = new File("C:/Users/Mr Bucket/Documents/MemoryStor/MemoryStor Project Files/Textures/MemStorIcon.png").getAbsolutePath(); ImageIcon icon = new ImageIcon(filePath); Image image = icon.getImage(); frame.setIconImage(image); frame.setVisible(true); } } class SquarePanel extends JPanel { @Override public void paintComponent(Graphics g) { super.paintComponent(g); Graphics2D g2 = (Graphics2D)g; int Sx = 10; int Sy = 10; Color[] colors = new Color[] { new Color(0, 100, 0), new Color(0, 0, 0) }; g2.setColor(new Color(0, 100, 0)); for (int i = 0; i < 2; i++) { for (int j = 0; j < 4; j++) { g2.setColor(colors[(i + j) % 2]); g2.fillRect(Sx, Sy, 64, 64); Sx += 64; } Sy += 64; Sx = 10; } g2.dispose(); } }