Java Swing的日期选择器GUI组件 [英] Date Picker GUI component for Java Swing

查看:1358
本文介绍了Java Swing的日期选择器GUI组件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我确信这个问题已经被问过了,但是我找不到答案。我正在寻找一个日期选择器 GUI组件,我可以从 Netbeans IDE拖放。我发现以下。


  1. ,只要你不尝试并且销售它,你应该能够自由使用,你也可以访问源代码,所以如果你想添加功能,你也应该能够。我建议,如果你这样做,你应该通知他们,并提供你可以做的更改,以便社区可以受益。



    JXDatePicker 是高度可定制的,但你需要用一些代码将你的手弄脏成为最好的功能...


    I am sure this question has been asked before, but I could not find the answer. I am seeking for a Date Picker GUI component which I can drag and drop from Netbeans IDE. I found the below.

    1. http://toedter.com/software/ - This is not free for commercial use.

    2. http://plugins.netbeans.org/plugin/658/jdatechooser-1-2 - This has issues, the dates are invisible.

    So anyone know whether there is a free for commercial use Date Picker component for Java, which we can drag and drop from Netbeans?

    解决方案

    Netbeans will allow you to drag any component that extends from JComponent, so long as the class is within the project's classpath.

    Once the jar file has been linked to your project, you should be able to expand the jar contents (under the libraries node) and drag the class onto the form.

    I do this for my own custom components (.java files) all the time.

    If this seems cumbersome, you can also add the components to the Swing component palette.

    • From the Tools menu, select Palette -> Swing/AWT Components
    • Create a new Category for your components
    • Select "Add from Jar..."
    • Select the Jar, make sure that the Jar is within a stable location AND is added to any project that wants to use the components!
    • The wizard will scan the contents and present you with choices you can add, select the components that you actually want
    • Select the category that you want them added to (probably the one you just added) and select "Finish"

    In the palette, expand your category (make sure you selected it within the "Palette Manager") and you should all the components

    A, general, free to use component library is the SwingLabs, SwingX library, so long as you don't try and sell it, you should be able to use freely, you also get access to the source code, so if you want to add featrues, you should also be able to. I would suggest that if you do, you should notify them and offer what changes you can, so the community can benefit.

    The JXDatePicker is highly customisable, but you'll need to get your hands dirty with some code to be the best features...

    这篇关于Java Swing的日期选择器GUI组件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆