Updating a jlabel

But i don't know how to use it...please can any one help me with the Timer() code....???? Well I'm not going to just do it for you as that's not what we do here.

Just follow what Casi Oo did in his code sample but change it to your class name. For you its probably best just to implement the Action Listener in the class you already have. I can't seem to update a JLabel on an application in Java I have an int build into is (like a counter) so it counts up on wins for a game, but it doesn't want to "live" update, how could i do this?I am in need of assistance with regards as to how to update a JLabel on a JPanel - when an array is updated.I dont get ur last sentence...."Then in the action Performed method you just need to set the text of the label to the current time, as you did previously in the constructor." can u give me an example of it... public class Main Screen extends JFrame implements Key Listener{ // Main game screen private JFrame main_frame; // Grid that the game plays on (This is a separate class in its own file) private Play Grid play_grid; // A label to display the score private JLabel score; . My Play Grid object has a field in it that keeps track of a score. If so, then why do you have a container keeping track of your player scores? This can be layouts, what's on the screen at what time, etc.

Search for updating a jlabel:

updating a jlabel-32

Leave a Reply

Your email address will not be published. Required fields are marked *

One thought on “updating a jlabel”

  1. Nor am I one of those stressed out kinds of single people, who appear to view finding “the one” in a similar way to defusing a bomb. So when we went to Comic-Con (full report on that HERE) and Stephanie said, “You are going to do this Sci-Fi Speed Dating thing,” I was like, “Okay.” I have never done speed dating or Internet dating or blind dating before, so I thought it would be cool to give my dating life a weird edge for once.