Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.
  • 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:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

redrawing screen in swing with new data  RSS feed

 
Ranch Hand
Posts: 147
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?
 
Bartender
Posts: 4519
50
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: 147
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
Bartender
Posts: 4519
50
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: 147
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That worked... thank you.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!