Vatsal Dholakiya
Vatsal Dholakiya

Reputation: 565

Cannot add JDateChooser to IntelliJ IDEA palette

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.

Upvotes: 0

Views: 1820

Answers (1)

darwinbeast
darwinbeast

Reputation: 1

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

Upvotes: 0

Related Questions