wood burning stoves*
The moose likes Swing / AWT / SWT and the fly likes Problem with saving a state in calendar program. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Problem with saving a state in calendar program." Watch "Problem with saving a state in calendar program." New topic
Author

Problem with saving a state in calendar program.

Al Do
Greenhorn

Joined: Oct 13, 2011
Posts: 5
I have attached a calendar program currently being used in a bigger program. However there is a problem with saving on the component picked. Currently it changes the background colour when the button is clicked but when another square is clicked on then the background colour changes back to normal is there anyway to keep the background colour when another square is clicked on.



Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
311 lines and it doesn't compile?

you expect us to read all that, and build a calendar in our head, then click imaginary buttons,
and see all sorts of colors changing.

you try it first, let us know how it goes.
Al Do
Greenhorn

Joined: Oct 13, 2011
Posts: 5
Sorry there was some stuff linked to other parts of the program.
Here is the main



Here is the calendar:



It now compiles, sorry about that.
Roberto Perillo
Bartender

Joined: Dec 28, 2007
Posts: 2247

I think this question has more to do with Swing, so let's move this over to the Swing forum.


Cheers, Bob "John Lennon" Perillo
SCJP, SCWCD, SCJD, SCBCD - Daileon: A Tool for Enabling Domain Annotations
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
your have coded the background to be reset.

in clearDayActive() you have
b.setBackground(b0.getBackground());

comment out that line and it should do what you want,
but you'll need to add some method to reset the colors when necessary.

have you thought about a JToggleButton?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem with saving a state in calendar program.
 
Similar Threads
table problem?
changing the color?
Help Needed
user selection of multiple items?
Displaying all the months in the year