I am trying to add a label to my gui, i am using the following code but it is not showing.
Can some one tell what i am doing wrong please
contentPane = this.getContentPane(); contentPane.setBackground(Color.GREEN); contentPane.setLayout(null); JLabel greeting = new JLabel("hello"); greeting.setFont(new Font("SansSerif", Font.PLAIN, 18)); contentPane.add(greeting); greeting.setVisible(true);