[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 240
  • Last Modified:

refreshing a JButton

I have a JButton with text on it, and I'd like to refresh that button with new text when it is clicked.  Is there a way to do this without refreshing the whole JFrame?
0
swp3h6
Asked:
swp3h6
  • 3
1 Solution
 
CEHJCommented:
button.setText("new text");
0
 
CEHJCommented:
(Put that in actionPerformed of your handler)
0
 
swp3h6Author Commented:
wow thats easy... i looked for such a method, but was unable to find it.

thanks!
0
 
CEHJCommented:
:-)
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now