• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

Unable to remove panels from a frame

 
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I would like to switch between screens so I thought switching btw panels is a good idea but I am not really able to remove panels and put new panels into the frame. I appreciate any kind of help in this context....thanks

the code which does this in my program is...



This is the full working program:

 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try to post small code samples. Most people will see more than 20 lines of code and move on to the next question.
You can solve your problem with a Card Layout
 
Raghavan Chockalingam
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I can not change layout again. Already I had problems with sizing in GridLayout so I chose GridBagLayout, now you are asking me to change to Card layout and that requires work.
1. Could you tell me what exactly is the problem why does not it work???

2. I just want to know how you guys switch btw screens or do you change frames or panels or remove/add components in panels

You commented to put short codes, if you see the post again, I have the given the piece of code which does not work and have given the whole program for users to run and see how it works and where the problem is....hope you do understand me...
 
Raghavan Chockalingam
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have solved the problem. The problem was because of the absence of pack() statement after I remove/add panels to the frame.
 
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you should use the panel.validate() also if you have the chance this will help you.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic