• Post Reply Bookmark Topic Watch Topic
  • New Topic

redrawing screen in swing with new data  RSS feed

 
John Morgan
Ranch Hand
Posts: 78
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am working on a program to track blood sugars and medication but I cannot seem to get the application to redraw the screen once I click the button.

Any suggestions?
 
Carey Brown
Saloon Keeper
Posts: 3246
46
Eclipse IDE Firefox Browser Java MySQL Database VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Looks like your code listing was cut off before showing the code to update the labels.
Have you put in some print statements to see what the actual contends of your HashMap are?
 
John Morgan
Ranch Hand
Posts: 78
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not sure why it got cut off but here is the rest.


I have put print statements and can see the data but it does not show up on the screen once I press the button. I have even tried to add "initialiize();" and "new initialize();" (without the quotes) at the end of my btnGetInfoActionPerformed method.

Carey Brown wrote:Looks like your code listing was cut off before showing the code to update the labels.
Have you put in some print statements to see what the actual contends of your HashMap are?
 
Carey Brown
Saloon Keeper
Posts: 3246
46
Eclipse IDE Firefox Browser Java MySQL Database VI Editor Windows
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You'll need to include a line like
lblMedVal.setText( ... );
But this requires that the lblMedVal variable be a class field (instance variable) rather than a variable local, and visible only, to your initialize() method.
 
John Morgan
Ranch Hand
Posts: 78
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That worked... thank you.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!