File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

refreshing JFrame?

 
jeff krystyan
Greenhorn
Posts: 9
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 1776
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10976
11
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
jeff krystyan
Greenhorn
Posts: 9
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you Maneesh,

i made those changes and it works perfectly now
 
Maneesh Godbole
Saloon Keeper
Posts: 10976
11
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are welcome!
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic