Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Calendar Program  RSS feed

 
Markus Tran
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am making a calendar scheduling program for my major project. That being said our teacher does not teach us much about GUI and we are supposed to look at outside sources (aka other peoples codes, java websites) for things that we might not know/understand. So what I am tasked to do is to have some sort of date picker. The problem is is that I do not know how to make my spinner change the time of day (with AM/PM). Along with that I also need some sort of calendar layout. I essentially am looking to have the same interface as your computer clock does (aka double click on the time on the bottom right of your screen). If anyone has any specific code/tutorials that could help please do so.
 
Rob Spoor
Sheriff
Posts: 20904
81
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The time part is easy: use a JSpinner with a DateSpinnerModel and a JSpinner.DateEditor with a pattern of HH:mm:ss.

For the rest: if you use google for "java date picker" I'm sure you can find at least something that you like.
 
Markus Tran
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The only problem though now is that I cannot get my spinner to change the time. Pressing the up/down arrows does not change the numbers.
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
> The only problem though now is that I cannot get my spinner to change the time.

almost like telephoning your mechanic and saying "my car won't start, what's the problem"

like the mechanic, virtually impossible to answer without seeing the car/code.
 
Campbell Ritchie
Sheriff
Posts: 53779
128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Maneesh Godbole:
My favorite.


That's a lovely app, isn't it? But it hardly helps the poster to copy Toedter's code.
 
Rob Spoor
Sheriff
Posts: 20904
81
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Markus Tran:
The only problem though now is that I cannot get my spinner to change the time. Pressing the up/down arrows does not change the numbers.

It will if you double click (or select) the number you want to change first.
 
Markus Tran
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Fixed my value changing issue but now I am wondering how I can stop it from using the god awful default theme and use the WinXP default theme.
 
Rob Spoor
Sheriff
Posts: 20904
81
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out UIManager.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!