0

I am trying to use JDatePicker in java, I am creating my application using notepad and all of the tutorials I have seen using this have been on either netbeans or eclipse. I am wondering how I could implement a date picker, I have tried following along with this:

http://www.codejava.net/java-se/swing/how-to-use-jdatepicker-to-display-calendar-component

however, I get the error

cannot find symbol class UtilDateModel
cannot find symbol class JDatePanelImpl
cannot find symbol class JDatePickerImpl

I have added the jar file to the folder that the class file is located which I am guessing "class path" means. Thank you for any help.

Andrew Harris
  • 396
  • 7
  • 24
  • did you import the classes in your code? – JohnnyAW Dec 19 '17 at 20:11
  • You need to either import the classes on your Java files and / or your classpath – Frakcool Dec 19 '17 at 20:14
  • i imported java.util.Date. and that gave the same errors, i am also not quite sure on what to import – Andrew Harris Dec 19 '17 at 20:16
  • It's not `java.util.Date` but rather `org.jdatepicker.UtilDateModel`... – Frakcool Dec 19 '17 at 20:18
  • IMHO you either learn [how to declare your classpath manually](https://stackoverflow.com/questions/219585/including-all-the-jars-in-a-directory-within-the-java-classpath) (everytime you want to compile) or go with an IDE (Eclipse, IntelliJ, NetBeans) that can manage that for you... I also recommend using Maven as well for your dependencies. An IDE will also do the imports for you or help you choose the one you want. IDEs are your friends, not your enemies – Frakcool Dec 19 '17 at 20:19
  • 1
    *"I have added the jar file to the folder that the class file is located which I am guessing "class path" means"* - I'd encourage your from stop guessing, but I would say that your guess is wrong. You can specify the class-path for the `javac` and `java` to use via the command line parameters, or better, as Frakcool has suggested, use a decent IDE to automate the process – MadProgrammer Dec 19 '17 at 20:23
  • @frakcool it says that the package does not exist. I would love to use an IDE but I am not allowed for this assignment. I will try to declare the class path manually, thank you. – Andrew Harris Dec 19 '17 at 20:25
  • Well, yes, it doesn't exist in the current classpath it could exist once you add your new classpath – Frakcool Dec 19 '17 at 20:27
  • maybe this could help you: http://www.sergiy.ca/how-to-compile-and-launch-java-code-from-command-line/ – JohnnyAW Dec 19 '17 at 20:52

0 Answers0