-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
General Discussion #2
Comments
Thank you for the great instrument. It is realy light and usefull. If you do not mind some ideas:
|
Hello Taurendil,
This is a good idea for flexibility. I added a feature request for this feature. See #7. In case the intention is to make sure that the user cannot type invalid text: It's probably worth noting that the component does automatic validation, and the user cannot commit invalid text to the date picker. If the user types text that is not a parsable date, or is not a valid date, or is a vetoed date, then they receive feedback while they are typing in the form of visual font and color cues. If they leave the field while the text is not in a valid state, it is automatically reverted the last valid state.
The date picker currently has the ability to set the date format. For a working example, see the demo application for the date that is labeled "Custom Date Format". You can set the date format by changing one or both of these two variables to something different than the default values: "DatePickerSettings.formatForDatesCommonEra" and "DatePickerSettings.formatForDatesBeforeCommonEra".
Yes I would like to do so, but there are hurdles. Maven Central and sonatype.org publish a list of requirements for adding projects the central repository, and there are a some items on that list that I've never done before. I was reading about the project requirements yesterday and it sounds like it would be a pretty big undertaking. If there was a developer who had published to maven central before who was helping to change the project to meet the requirements, it would go a little faster. Either way, I would guess that the project will eventually be added to maven central. warm regards, |
Super. This is usefull when the application has to be sure user would have no problems with dates.
Sorry, I have not studied demo application well enough. I've runned it and saw the month is written in the words instead of numbers, and I made wrond conclusions. My fault. Another one question to you. Now I am migrating from Microba to LGoodDatePicker, but I found that in my application buttons to switch the month and year are not displayed full. I believe it is because of Nimbus style. When I switch it off, buttons appears well. Please look at two screenshots below. The first one is with NImbus style, second without any style. Sorry for Russian language, but it is the only language of the application. It there any way to fix it? |
Taurendil, By the way, it looks like the default button size is really large in the Nimbus look and feel (which is one reason they were displaying weird before hand). However, the Nimbus look and feel is unique in that it supports built-in resizing of the components. I have not tried the other Nimbus sizes with the date picker, but this page explains how to do it, in case it is of interest to you: Changing the Nimbus size variant. Let me know if you have any other problems. |
Taurendil, Warm regards, |
Blake, super, it does work fine. Thank you very much. Now I see you have dependency on jgoodies. Is it a permanent solution? |
Taurendil, I'm glad that the new features are meeting your needs.
Yes, The project definitely needs jgoodies. There are some design specifications that require the jgoodies FormLayout. (For example, the columns that contain the forward and back month/year navigation buttons need to be grouped so they always have the same size, even across different swing looks and feel settings.) Note: You don't need to manually include jgoodies in your projects. The jgoodies library is included and packaged with the LGoodDatePicker distribution jars using Maven Shade. Also, the included jgoodies classes will not conflict with anyone who happens to use another version of jgoodies, because the shading process renames the required classes at the same time they are included. The code has not significantly increased the size of the LGoodDatePicker jar files, because only the jgoodies classes that are used, were included by Maven Shade. By the way, I imagine that you'll want to start using LGoodDatePicker 4.1.2. Is a major upgrade from the previous versions. Two new components have been added to the original date picker: A TimePicker, and a DateTimePicker. The demo has also been updated to show the new features. Besides the new features, there were a number of bug fixes and improvements to the original code. Screenshots of the new components are included at the bottom of the LGoodDatePicker front page. warm regards, |
Blake, thank you for explanation, I have nothing against JGoodies, I just wanted to know if it is final solutions. LGoodDatePicker is excelent light library. I've just added new jar to my maven local repository and everything goes well. So waiting for publication in Maven Central. If you need any help please write to me. But I have no publication in Maven Central. TimePicker is excelent feature, thank you for your support. BTW, what do you think about any icon at the button next to the field for DatePicker and TimePicker (like in Microba project)? I can draw icons for you if you need it as a small support from my side. |
This comment was replaced because it is out of date. The library now has the ability to add custom image icons. (This feature was added in LGoodDatePicker 5.4.1) |
Hi Taurendil, Here are the LGoodDatePicker project pages at Maven Central: Maven Central, or MVNRepository. warm regards, |
Hello Blake, after running maven with -U command repo updated and found LGoodDatePicker. I have to update project to meet 4.3.1 as it has different namespace. If I has any error I'll contact you. Thank you for perfect instrument!!! It really helps a lot, because there is only few good datepickers. Previously I used Microba, but it is rather old. The only request is availability to change icon on button next to date field. |
Oh. Oops. I just opened an issue... Shall I close it? Anyway, the point is I love this date/time picker. I need seconds in my time picker though. I know it seems like a bad use case, but we're trying to match a date EXACTLY. Even milliseconds would be helpful, but not required. I really do need seconds though. How do I enable that? Is there any built-in option? |
Hello karlmortensen, I've added three new examples to the demo application which show how to use seconds, milliseconds, or nanoseconds precision in the time picker. You can see the new examples in the executable demo, in the the release section under LGoodDatePicker 4.3.2. Here's an example of how you would enable millisecond precision.
To do the same thing with a DateTimePicker, you would create your time settings the same way, but you would pass the settings to the DateTimePicker constructor instead of a TimePicker constructor. If you need to create a custom or different time format, a description of all the available "pattern string" codes can be found in the javadocs for the DateTimeFormatter class. Thank you for the compliments of this project. If you like, please add a "star" for the project on the top of the project page, to increase the project ratings. If you wish to be notified of any new releases, then you may also want to "watch" the project on the same page. warm regards, |
Works perfectly. Thank you so much. You created the release of the example the same day I asked. That is awesome! |
karlmortensen, You're welcome! |
I just came across your component and I have to say it really nails it! I have been using JCalendar for years and struggled with bugs, LocalDate support is a must! Thanks for that. There is however a requirement for multiple calendars inside a panel e.g. 2, 4 etc that behave as one for the external application caller. Think something like MS Outlook, which can have multiple calendars and pressing < or > changes all the shown calendars respectively. I am thinking I could use a panel to create a custom component for my needs, but you seem much more skilled and determined for the task... :) |
*** Reply deleted because it is now out of date. See the post below for information about using multiple calendars in a single panel. (updated 25apr16) *** |
Hello gregkotsaftis, With this component, it would be possible for the programmer to show multiple calendars on a single panel (in a single interface), similar to the example you described above. |
Hi Blake, |
Hello Gittino, You can apply custom formatters to your date picker in the DatePickerSettings class, (there is no need to retrieve the text field to change this setting). Here is the applicable example, as copied from FullDemo.java (the demo program):
To use other formatters besides the example in the demo, you'd replace the format strings with your own desired format. The codes for creating format strings are shown in the DateTimeFormatter javadocs. I believe that the format strings for this format ("30/05/2016") would look like this: Thank you for the compliments on the library, and have a great day. Warm regards, |
Perfect, thanks a lot! |
** A section of this conversation has been moved to Issue 13. The moved conversation relates to adjusting the vertical and horizontal size of the DatePicker text field, as needed. Thank you. -Blake ** |
Hello Blake and thank you very much! |
Hello gregkotsaftis, From your description, is not clear to me what features of the calendar panel you would need or want. Your describe usage would probably be considered "advanced", since you would be basically using the calendar panel to create your own new multi-calendar component. Because of the complexity, I doubt that we could answer all significant questions before you started writing any code. I imagine you would need to start exploring the current source code and creating your new interface in order to pinpoint and define your specific needs. If you want your project to be visible to other developers, including me, you could consider keeping your source in a github repository. I would not suggest overriding the class as a general solution for modifying the class behavior. If it turns out that there are features that you need that are not currently present (which is probably likely), then I would suggest incorporating those features into the LGoodDatePicker library. This could be accomplished by forking the repository and writing your own feature additions (and submitting pull requests for incorporating your changes), or by creating feature requests, which other developers could implement. Since this is an open source library, you're able to modify the code as desired. To try to answer your questions, each calendar does have a concept of a selected date, but you are free to use or ignore that date as desired. The calendar does not currently have the ability to "ignore user input" (to become "read only") but that is a possible feature request or code addition that you could implement, if desired. And you are able to programmatically change the displayed month for "linked calendars", by calling setDisplayedYearMonth(). Warm regards, |
Hello All, If desired, the default minimum width may also be overridden by the programmer, using DatePickerSettings.setSizeTextFieldMinimumWidth(). This release implements Feature Request #13, and should also fix the width related portion of the size problem described by @gittino. (The details of that conversation were moved to feature request #13). Warm regards, |
Hello All, Over the last two days, two major enhancements to the library were added to the Release Section. Here are the highlights:
warm regards, |
Hello Blake, thank you for support of customs icons. You know, I found one problem. Could you explain it. |
Hi @Taurendil, An interim solution for your program would be to create and initialize your DatePickerSettings instances inside a loop. That way you can pump out as many duplicate customized instances as you would like. You can also create your DatePickers inside the same loop, if desired. If needed for storage and management, the multiple instances of the settings or the pickers could be added to an array list with each loop iteration. warm regards, |
Hi @BlakeTNC, class A {
private B intB;
public A (B extB) {
intB = extB==null ? null : extB.clone();
}
} So intB and extB are different object and outside code has no effects on intB anymore. |
Hi @Taurendil, Note: The new function is not named DatePickerSettings.clone(), it is named DatePickerSettings.copySettings(). This is because the new function needs to work slightly differently from the general contract for Object.clone(). For additional information, see the Javadoc for DatePickerSettings.copySettings(). warm regards, |
Thanks for that help! Great product! |
That's a great tool, thank you and good job! So then the user could select the month from the panel and maybe have spinner buttons to increase/decrease the months directly to the TextField (With a pattern like "MM/uuuu") or have the months in the panel switch between the month name or its number representation? |
Would it be possible to do another release version, and update the maven repositories? Thanks for maintaining this great tool! |
@ArchieBlack The Maven Central Repository upgrade process had to be done manually up until now. I have setup some CI scripts that do this automatically from now on. As a result a new bugfix release can be created very easily. |
Thanks. I'll let you know once I can pull the update. |
could i ask what should i do so that i could use this code....? // Create a date picker: With date range limits. |
Hello, just downloaded this to try out in an app at work. Was curious if there is a way to set the text fields to be set the overwrite mode as true? We used to use javax.swing.text.DateFormatter and really like the overwrite behavior versus having to delete existing text. Thanks! |
@jcadam14 I'm not sure how the overwrite mode you are describing works in detail. One thing you can try is to customize your DatePicker instance by accessing the |
@BlakeTNC Hello, how do I set the font size of the time picker component of datetimepicker? I figured out how to set the font size of the date picker by looking at the code for the demo, but I couldn't figure it out for the time picker. This is my code:
The method .setFont isn't valid for timeSettings. I would appreciate any help. |
Hi, we started to use this lib a few weeks ago as a replacement of JCalendar (starting to move on from Date to Localdate/time, and moving projects to java 11) and we (my team) couldn't help to wonder why are you requesting |
Hi @FiruzzZ, If you have a better API in mind that would suit your purposes better you are very welcome to propose it via a pull request. |
That exactly my point, there no reason to ask (as parameter or return) for ArrayList when you just need a List
I would like to but sadly there is no way to guaranty backward compatibility because to make the API more flexible ("programming to an interface") the declaration of |
@FiruzzZ thank you for your detailed explanation. You are right, the change of the setter to Nevertheless you could still prepare a PR with theses API changes, since this incompatibility of the getter is not very severe in my eyes. The only downside is that we can only ship this with the next major version |
Hi I’m Ted Larkenso
|
For two hours I am looking for any helpful section to guide me how to use LGoodDatePicker within my Java swing code, but couldn't find any hint! How to use LGoodDatePicker? From assets (https://github.com/LGoodDatePicker/LGoodDatePicker/releases), Which file should I download to include to my project that I can use it within my code. Where is the usage section? |
To include the datepicker library in your project, you would need to download "LGoodDatePicker-11.2.1.jar" (or the latest version). Alternatively, you could include the library as a maven dependency if you have a maven project. These links explain the process under various IDEs.
Usage demos and examples are located here: |
I believe you can set the default display month, so that a different month than "today" will be shown when the datepicker is opened or clicked. Besides setting the default month, I don't believe the datepicker currently has a way to show the days "outside the edge" of the currently displayed month. That could still be possible with extra work. This is an open source library, so a developer could optionally add the described capability, and submit it to the project as a pull request. |
hello
In advance, thank you very much for your answers. Translated with www.DeepL.com/Translator (free version) |
Hello Blake, I want to use the Datepicker inside my Jtable. Everything works fine except two things:
This is how I add the Datepicker inside my custom JTable class: private void addDatePicker() { Thank you in advance! |
I fixed it myself: For the tables Default Editor I gave a new DateTableEditor object as parameter without my settings. My solution is to declare two DateTableEditor objects, with the same settings (but different settings objects) for the DefaultEditor and the DefaultRenderer. This might be redundant and unnecessary but I can't seem to find a better solution. This is my new code: private void addDatePicker() {
} Any tips are still much appreciated! |
@CMFerrer Modifying the textfield border color has now been implemented in the master branch. Thanks to @john-dc252. |
How can I set the language? |
@Coelho42
|
It might be a good idea to enable the actual discussion section through repository settings |
@TheRedSpy15 Done, thank you for mentioning it. |
hii, any references about how to use this lib in compose multiplatform ? especially for desktop |
This "issue" is a free-form place for people to talk about things related to LGoodDatePicker. You can write any thoughts, ideas, etc, without needing to frame the discussion into an issue unless that format is needed.
The text was updated successfully, but these errors were encountered: