Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Date Picker GUI component for Java Swing [closed]

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?

like image 398
PeakGen Avatar asked Oct 12 '14 08:10

PeakGen


People also ask

Does Java Swing have a date picker?

The date picker lets the user select the Date through an easy interface that pops up with a Calendar. The user can navigate through the Calendar and select a date. It contains an editable date picker, a date field, a multiple month calendar and a month component. You can select any date from the Date Picker.

What are the component components in a Java Swing GUI application?

In Java Swing, there are a number of components like a scroll bar, button, text field, text area, checkbox, radio button, etc. All these components together, form a GUI that offers a rich set of functionalities and also allows high-level customization.

Is Java Swing good for GUI?

Swing in Java is a lightweight GUI toolkit which has a wide variety of widgets for building optimized window based applications. It is a part of the JFC( Java Foundation Classes). It is build on top of the AWT API and entirely written in java. It is platform independent unlike AWT and has lightweight components.

What has replaced Java Swing?

Swing is a newer way of making a GUI. All objects in Swing are derived from AWT, and most objects in Swing start with the letter J. Hint: Oracle has developed JavaFX to replace both Swing and AWT. Since Java SE 7, update 6 it is bundled with Java SE.


1 Answers

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

DatePicker

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...

like image 196
MadProgrammer Avatar answered Sep 20 '22 00:09

MadProgrammer