Java Swing custom controls

I want to know how to create a new swing control

My problem is that some components are missing on swing (for example, datepicker)

I checked stack overflow (and other websites) and found some old answers, but failed (several links no longer work)

So can you point me in the direction?

Solution

You can use a large number of components in your application Google will help you find them An example of a datepicker is JCalendar and Java Swing date picker Just download it, add the jar to your application and use it You can easily add it as a bean to the palette of the IDE and drag and drop it like JButton JCalendar also has a jdaychooser, jyearchooser, several spinner beans, and a jlocalechooser I have been using Kai toedter's JCalendar for several years and highly recommend it Localization is simple

If you want to create your own controls, you must create them as Java beans The object must be serializable with a parameterless constructor and accessors and transformers named set, get, and is An old but good article on JavaBeans is in Java world You can learn the Java source code of JCalendar

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>