I am trying to fetch data from database where date = jdatechooser:

我是研究僧i 提交于 2019-12-02 03:44:57

It's theoretically possible to have a window with lots of different JDateChooser controls on it. So when you refer to one of them, you need to specify which one, rather than just calling it JDateChooser.

Somewhere in your class, you'll have a declaration something like

private JDateChooser theChooser;

where you declare a variable to refer to your JDateChooser - that is, you give it a name. Now, you need to use the EXACT SAME NAME when you refer to your JDateChooser in your actionPerformed method. For example

Date date = theChooser.getDate();  

But don't write theChooser - write whatever name YOU gave the JDateChooser when you declared the variable.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!