Cannot add JDateChooser to IntelliJ IDEA palette

1.3k views Asked by At

I want to add the JDateChooser component from to the designer palette in ; but when I'm adding com.toedter:jcalendar:1.4 through Maven dependency or JAR, I'm getting an error:

class "com.toedter.calendar.Jdatechooser" cannot be instantiated:
index 0 out of bound for length 0

Same JAR file works in Netbeans GUI editor.

If anyone has an idea of how to add JDateChooser in IntelliJ IDEA then please share your answer.

Note: This is not a duplicate of questions about adding as a library.

1

There are 1 answers

1
darwinbeast On

Try adding a JPanel and then setting it's layout to borderlayout in Layout Manager. Then add the add to your Main Form.

JDateChooser dateChooser = new JDateChooser(); //initializing the calendar jpCalendar.add(dateChooser); //adding the calendar component to JPanel