This week's book giveaway is in the Spring forum.
We're giving away four copies of Spring in Action (5th edition) and have Craig Walls on-line!
See this thread for details.
Win a copy of Spring in Action (5th edition) this week in the Spring forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

redrawing screen in swing with new data  RSS feed

 
Ranch Hand
Posts: 149
2
  • 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?
 
Saloon Keeper
Posts: 5140
54
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: 149
2
  • 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: 5140
54
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: 149
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That worked... thank you.
 
He loves you so much! And I'm baking the cake! I'm going to put this tiny ad in the cake:
Download Free Java APIs to Work with Office Files and PDF
htttp://www.e-iceblue.com/free-apis.html
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!