Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Swing / AWT / SWT
Search Coderanch
Advance search
Google search
Register / Login
Win a copy of
Cloud Application Architecture Patterns: Designing, Building, and Modernizing for the Cloud
this week in the
Cloud/Virtualization
forum!
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Tim Cooke
paul wheaton
Paul Clapham
Ron McLeod
Sheriffs:
Jeanne Boyarsky
Liutauras Vilda
Saloon Keepers:
Tim Holloway
Carey Brown
Roland Mueller
Piet Souris
Bartenders:
Forum:
Swing / AWT / SWT
display a DateChooser on the click of a button.
soudamini shirkhedkar
Greenhorn
Posts: 2
posted 21 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi
I want to display a DateChooser that will come as a small pop-up window on the click of a JButton.
Any clues of how to do that?
Thanks.
Soudamini
Carlos Failde
Ranch Hand
Posts: 84
posted 21 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
I am going to assume you mean
DateChooser
but I could be way off.
Add an action listener to your button that constructs a new DateChooser, displays it, and then queries it for the selected date.
import net.homelinux.wiz.datechooser.DateChooser; ... JButton button = new JButton("Push me"); button.addActionListener ( new ActionListener() { public void actionPerformed(ActionEvent e) { DateChooser datechooser = new DateChooser(frame, true, "Choose a date", 0, 0); datechooser.setVisible( true ); String s = datechooser.getSelectedDate(); // do something with the string here. } } ); ...
[ April 25, 2004: Message edited by: Carlos Failde ]
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
JDateChooser needed
Swing Inner Classes
How to display a popup menu on right click in swing
Adding rows to Jtable
how to do validation using java swing?
More...