This code inside a JFrame form created in netbeans works fine as i’m trying to put a JCalendar in a panel that i create manually.
JCalendar myCalendar =new JCalendar();
JPanel customPanel = new JPanel();
customPanel.setSize(400, 250);
customPanel.setBorder(new LineBorder(Color.BLACK));
customPanel.add(myCalendar);
this.add(customPanel);
However if i create a panel in netbeans with the help of visual gui builder(matisse)
and then use this code
JCalendar calendar2 =new JCalendar();
netbeansPanel.setSize(400, 250);
netbeansPanel.add(calendar2);
the JCalendar is not visible>Any ideas?
Thank you
Did little research and found the solution 🙂
Actually when you add components through Netbeans GUI Builder, it is adding components in GroupLayout and in that we have to add the components like this (Got this idea from the generated code by netbeans).
Good luck.