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

前端 未结 1 1268
悲哀的现实
悲哀的现实 2021-01-25 05:04

I have a table with a column datetime i want to retrieve data from database where date is specified in jdatechooser but em continously getting error:

Cann

相关标签:
1条回答
  • 2021-01-25 05:39

    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.

    0 讨论(0)
提交回复
热议问题