• 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
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Next step in developing a calendar component

 
Ranch Hand
Posts: 345
1
Mac Eclipse IDE Safari
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My ultiimate objecttve is to replace the rather basic plain jspinner controls I am using for date / time entry on my input forms. I have created a class called JCalendar which extends JPanel and has all the necessary functionality to display the date and time. Image attached. What I'm hoping someone can help me with is the next step. I'm not sure if I want to subclass the existing jspinner and add another button to the right which will invoke my panel, or just go for a simple read only display of the date time with a button next to it which will invoke my code.

I have to admit that creating a date time component is not my ultimate goal, but I've not found an open souce date and time one, only commercial. So far it's only taken me a couple of days to get the calendar logic right, but I've not delved into creating my own controls before and I was hoping for a an example of something similar which I can use as a head start.

Bits which may or may not be difficult are when the panel overlaps the edge of the frame and does not fit on the desktoppane - dunno - just thinking out loud.

Any links to resources which you think may point me in the right direction would be great.

Thanks

Dave
2010-05-29_201704.gif
[Thumbnail for 2010-05-29_201704.gif]
2010-05-29_201515.gif
[Thumbnail for 2010-05-29_201515.gif]
 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Don't quite see what your question is here... can you be more specific?
 
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
> I'm not sure if I want to subclass the existing jspinner and add another button to the right which will invoke my panel,

unless you want to use the spinner buttons to increment/decrement the spinner value without your panel showing,
you could remove the existing listeners from the spinner buttons, then use those buttons to trigger your panel showing,
instead of adding another button.

the above may depend on the L&F used.


> Bits which may or may not be difficult are when the panel overlaps the edge of the frame and does not fit on the desktoppane

I would have thought your panel would show in a popup, and java would/should/possibly does (?) handle that situation.


another possibility is to use a JComboBox with its built-in popup
a simple example is here
http://www.java.happycodings.com/Java_Swing/code15.html
 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

...but I've not found an open souce date and time one, only commercial..


http://www.toedter.com/en/jcalendar/index.html
 
David Garratt
Ranch Hand
Posts: 345
1
Mac Eclipse IDE Safari
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you everyone. I will study the examples and adapt for my needs.

Appreciated.

Dave
 
What's brown and sticky? ... a stick. Or a tiny ad.
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic