• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
  • Piet Souris
  • Himai Minh

Updating a JLabel on a JPanel

Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am in need of assistance with regards as to how to update a JLabel on a JPanel - when an array is updated.

My main program passes in an arrayList to another JFrame program ( and I am able to confirm that the data in the arrayList has been passed into the program ). However, the jLabels are not being updated on the GUI when the program is ran. However, when I use the MOUSE to click on a section of the map I am able to update the map utilizing the mouse clicked and listener and I am then displaying the data from the arrayList.

I am using the same method (see below) to populate the labels so I know it works.

I know I need to employ an action listener to have the labels updated, but I have scoured the web to look for an example that utilizes a listener to update a JLabel and I have not been able to find one.

If anyone could offer assistance it would be greatly appreciated.

The only cure for that is hours of television radiation. And this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
    Bookmark Topic Watch Topic
  • New Topic