Label is not rendering
Can someone tell me what is the cause of the fact that I am adding a JLabel to my JFrame but it doesn't render anything? Here is my code: public static class Frame extends javax.swing.JFrame { public Canvas canvas = new Canvas(); // canvas is an extended version of JPanel public Frame(Vector dimension, String title) { this.setSize((int)dimension.x, (int)dimension.y); this.setTitle(title); this.setDefaultCloseOperation(javax.swing.JFrame.EXIT_ON_CLOSE); this.setBounds(0, 0, (int)dimension.x, (int)dimension.y); this.setResizable(true); javax.swing.JLabel label = new javax.swing.JLabel("Cancel"); // doesn't render for some reason this.add(label); this.setLocationRelativeTo(null); this.add(canvas); this.setVisible(true); } private static final long serialVersionUID = 1L; }