intellij-idea 无法将JDateChooser添加到IntelliJ IDEA调色板

dldeef67  于 2022-11-01  发布在  IntelliJ IDEA
关注(0)|答案(1)|浏览(275)

我想把JDateChooser组件从jcalendar添加到intellij-idea中的designer palette;但是当我通过Maven依赖项或JAR添加com.toedter:jcalendar:1.4时,我收到一个错误:

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

相同的JAR文件可在NetbeansGUI编辑器中使用。
如果有人知道如何在IntelliJ IDEA中添加JDateChooser,请分享您的答案。

**注:**这不是有关将jcalendar添加为库的重复问题。

toiithl6

toiithl61#

尝试添加一个JPanel,然后在布局管理器中将其布局设置为borderlayout。然后将其添加到主窗体中。
JDateChooser =新建的JDateChooser();//初始化日历jpCalendar.add(dateChooser);//将日历组件添加到JPanel

相关问题