• Post Reply Bookmark Topic Watch Topic
  • New Topic

my JInternalFrame isn't updating properly

 
KEvin Runion
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello.. I've been toying with this problem all day and figured I'd request some help before I go crazy.
I've made a MDI style application. I've created a calendar. I've created a day object that consists of a jpanel with various components; one being a textarea to display the day. I then have a calendar panel that uses a gridlayout manager to display and control a 7 by 6 grid of these objects.
I have this calendar panel loaded in a jinternal frame with a couple of combo boxes for changing the date. When the month or year is changed the calendar is object does goes through a for loop and clears all the day cells original information then load the days back in. I'm calculating how to populate the cells by using an offset that I get by setting a java.util.Calendar object DAY_OF_MONTH field to 1 and getting the DAY_OF_WEEK return.
Anyways, when the calendar changes months the numbers seem rather jumbled; for reasons I haven't figured out yet. But when I move the panel and it refreshes all the day numbers are correct. I've tried forcing a .repaint() at every point any object changes and that still doesn't seem to help. (unless I'm missing one).
It updates fine if I use a .pack() on my internalframe after I update the calendar, but that causes my frame to not look the way I had originally intended it.
To make a long story short, I'm trying to figure out a way to perform the same routine that moving the jinternal frame would do. Has anyone else witnessed this type of thing? or am I all screwed up here?
thanks in advance
-Kevin
 
Ram Nsou
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi ,, how r u ?
i noticed this update issue ... try using
removeAll();
before the update takes effect .. i used it and it worked ..

but i have another problem .. i use JInternalFrame as exteded JPanel ... and that doesn't work in j2sdk1.4.-- do u have any idea y ...
sorry i didn't reply earlier ... i just saw ur comment
 
KEvin Runion
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for replying, I'll give that a try. I did however find a go around. I passed a reference to the internal frame to the method that was creating the update and set it to .move() to it's current location. Seems to work rather nicely. Probably isn't best practice though.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!