This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Updating a JLabel on a JPanel Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Updating a JLabel on a JPanel " Watch "Updating a JLabel on a JPanel " New topic

Updating a JLabel on a JPanel

Dane Com

Joined: Jun 15, 2011
Posts: 1
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.

I agree. Here's the link:
subject: Updating a JLabel on a JPanel
jQuery in Action, 3rd edition