| Author |
refreshing JFrame?
|
jeff krystyan
Greenhorn
Joined: Apr 02, 2012
Posts: 8
|
|
Hey everybody,
I have a JFrame with a grid layout on it, each grid has a button. What I'm trying to do is remove all the buttons when a button is pushed. I believe I have it correct except that the JFrame won't refresh the revised panel. Advice?
Also, I noticed on some sites that people were able to paste their code in with lined numbers to make referencing it easier. Anyone know how i can do that to make it easier on you all to read? Thanks.
|
 |
John Jai
Bartender
Joined: May 31, 2011
Posts: 1778
|
|
jeff krystyan wrote:Also, I noticed on some sites that people were able to paste their code in with lined numbers to make referencing it easier. Anyone know how i can do that to make it easier on you all to read? Thanks.
You can use code tags to represent code in a better way. Please read UseCodeTags.
|
 |
Maneesh Godbole
Saloon Keeper
Joined: Jul 26, 2007
Posts: 8566
|
|
Welcome to the Ranch.
Please check out the link John provide to UseCodeTags I have added them this time for you.
You will also be able to edit your post using the No need to repost
In your code, you have declared ButtonListener but never used it.
Also, after removing the buttons, call revalidate and repaint.
This question would be more suitable on the UI forums. I will move it over there for you
|
[Donate a pint, save a life!] [How to ask questions] [Onff-turn it on!]
|
 |
jeff krystyan
Greenhorn
Joined: Apr 02, 2012
Posts: 8
|
|
thank you Maneesh,
i made those changes and it works perfectly now
|
 |
Maneesh Godbole
Saloon Keeper
Joined: Jul 26, 2007
Posts: 8566
|
|
|
You are welcome!
|
 |
 |
|
|
subject: refreshing JFrame?
|
|
|