Why doesn't the Card show up from the CardLayout:used JPanel,JFrame

hello guys,
this is a question regarding. As I did not get nice responses i am posting again today.
http://forum.java.sun.com/thread.jsp?forum=57&thread=235761
Hi, I would like to re-arrange my question and put it in a simpler way. I have a frame(mainframes.java) with border layout. There is a panel on the west(borderlayout.west) which has a few buttons. The center panel(borderlayout.center) has a cardlayout and needless to mention that it contains a deck of panels. When I click on a button in the left panel, an appropriate panel in the deck should be displayed in the center panel. It's all simple so far, but here comes the real problem. I have designed my application in such a way that I have each of my panels in a separate class(each of which extend JPanel) and I am trying to integrate them all in my frame. When I click on the button on the left panel(p.s.:this panel is also in a separate class), then the appropriate panel should be displayed in the frame(i.e. in the center deck).
mainframes.java:-
//This is the local method which takes an argument from the invoking panel and displays the corresponding card in the deck.
void showpanel(String p1)
this.cardLayout2.show(CENTERPANEL,p1);
System.out.println("Inside showpanel "+ p1);
leftpanel.java:-
void B_LOGIN_actionPerformed(ActionEvent e) {
new mainframes().showpanel("lp");
// I am trying to display the card "lp" when I click on a button in the leftpanel, but I can only get the console output as "Inside showpanel lp". This shows that the method showpanel(String lp) is getting invoked but the required card is not being displayed. i.e. this.cardLayout2.show(CENTERPANEL,p1) seems to be not working.
Thanks for your time. Mail me, if you want to access the complete code, at [email protected]

I'd check to make sure 3 things...
1) You have added your Panels to the CardLayout Panel
2) You have added the CardLayoutPanel to the center of your BorderLayout JPanel
3) Try giving calls to validate()/invalidate() on the JPanel containing the CardLayoutPanel
void showpanel(String p1)
... invalidate()
this.cardLayout2.show(CENTERPANEL,p1);
System.out.println("Inside showpanel "+ p1);
... validate()
Otherwise, I may just need to check your source code, you can send to [email protected]

Similar Messages

  • Why doesn't the repair box in Aperture show up? and if it does, once you choose repair does it give you an indication it is working?

    Why doesn't the repair box in Aperture show up? and if it does, once you choose repair does it give you an indication it is working?

    Winterwren22 wrote:
    Why doesn't the repair box in Aperture show up?
    Without more information, speculation is a waste of time.  At the least tell us what you do, what the results are, and how that result differs from your expectation.  Then tell us what steps you have taken to resolve the issue, and what the results of taking those steps was.
    once you choose repair does it give you an indication it is working?
    Adjustments you make are shown live.
    Instructions on the use of Repair Brush are here (ignore "Spot & Patch" -- it is superannuated).

  • A message is marked as unread - so why doesn't the Inbox count show it?

    There is a message marked as unread (the little blue ball) in an IMAP account's inbox.
    So why doesn't the Inbox show a (1) next to it to indicate there are unread messages?
    doug

    Thanks for your replies, people.
    I actually just created this IMAP account about a week ago.
    Yesterday I deleted a separate, POP3 account and recreated it as IMAP. At that time everything got re-indexed (at least the activity window was going on forever about rebuilding and reindexing this and that).
    Rebuilding from the Mail menu doesn't help.
    I might try removing and re-adding the IMAP account or the entire re-index later if I find this behavior annoys me too much. Will that lose my replied-to indicators?
    So anyway, what I am seeing is not normal? If you go to a message and mark it "unread" does your Inbox for that account go up by 1?
    Thanks,
    doug

  • What's the searchplugins folder and why doesn't its content show up in the Manage Plugins menu?

    Today on my first Search bar attempt, my search page got redirected from Google to www.bigseekpro.com, which I had never heard of. I checked my Plugins and Addons, it didn't show up there. But my home page had also been hijacked, from the tabs I normally go to, to only go to this new page. I did find in C:\uerdatada\appdata\roaming\mozilla\firefox\profiles\cawypqyo.default a new folder created a few moments before, \searchplugins, and in this a file search.xml, which contained xml commands to redirect the search activity.
    These look suspicious: the first command sets xmlsn:os to "http://a9.com", which I can't seem to find anything on with whois or tracert; bigseekpro.com itself traces to its registry at godaddy.com, but that's about all I'm finding.
    If this is a legitimate place for Firefox to look for a plugin, why doesn't the Firefox plugin manager tell me it found something there? And why couldn't the Help articles on "Search not going where you want it to" also tell me about this?
    Any ideas? Am I right to be highly suspicious of this behavior?

    Search engine plugins are kept separate from Add-ons (Extensions, Plugins, Appearance). Search plugins, both the default search engines supplied with Firefox and those that you install will be shown in the Search Bar (see [http://kb.mozillazine.org/Search_Bar Search Bar]).
    The folder '''''searchplugins''''' in your Profile folder ('''the path you mentioned''') is for search engines '''''added by you or something that you have installed'''''. You can remove any found in the Profile folder in the '''''searchplugins''''' sub-folder. The items there '''''may''''' make/have made changes to other search functions in Firefox.
    *Are searches from your '''Location Bar''' going to the place and/or search engine you expect?
    *Are searches from your '''Search Bar''' going to the place and/or search engine you expect?
    '''''The default search engines included with Firefox''''' are not in that folder in your Profile, but are located in a folder by the same name in the Programs folder where Firefox itself is installed. See [http://kb.mozillazine.org/Installation_directory Finding the Installation directory]
    '''If this reply solves your problem, please click "Solved It" next to this reply when <u>signed-in</u> to the forum.'''
    Not related to your question, but...
    You need to update some plug-ins:
    *Plug-in check: https://www-trunk.stage.mozilla.com/en-US/plugincheck/
    *Adobe Shockwave for Director Netscape plug-in: [https://support.mozilla.com/en-US/kb/Using%20the%20Shockwave%20plugin%20with%20Firefox#w_installing-shockwave Installing ('''''or Updating''''') the Shockwave plugin with Firefox]
    *Adobe PDF Plug-In For Firefox and Netscape: [https://support.mozilla.com/en-US/kb/Using%20the%20Adobe%20Reader%20plugin%20with%20Firefox#w_installing-and-updating-adobe-reader Installing/Updating Adobe Reader in Firefox]
    *Shockwave Flash (Adobe Flash or Flash): [https://support.mozilla.com/en-US/kb/Managing%20the%20Flash%20plugin#w_updating-flash Updating Flash in Firefox]
    *Next Generation Java Plug-in for Mozilla browsers: [https://support.mozilla.com/en-US/kb/Using%20the%20Java%20plugin%20with%20Firefox#w_installing-or-updating-java Installing or Updating Java in Firefox]

  • Why doesn't my message show up in the thread in email on I pad.

    Why doesn't my message show up in the thread in email on iPad ?

    You're welcome.  My mistake, I completely misread your question. Unfortunately currently  I don't have any email threads to check it out, just replys from the Apple Support Communities.Sorry.

  • Why does apple allow apps in the App Store hijack your Internet when certain websites? Why doesn't apple remove their products from the App Store?.

    Why does apple allow apps in the App Store hijack your Internet when certain websites? Why doesn't apple remove their products from the App Store?.

    Apple saw it as their responsibility since the redirection took me to the App Store. They assisted me in stopping the redirection which is occurring on many peoples iPhones. It's a have java script problem that adking is using to get you to buy their games. The websites work normal and then all of the sudden the website is taken over by adking.com.  You can no longer use the website as it immediately takes you to the App Store without ever showing a popup to cancel the redirection. They were very helpful fixing the problem should others experiencing this specifically with adking.com.
    No need to get defensive. I'm not the only one experiencing the problem Apple said.

  • Why doesn't the location information in an iCal meeting show up on my iPhone, when it does show up in iCal?

    Why doesn't the location information show up on my iPhone 4S calendar when I accept an invitation to a meeting?
    The other information such as the date, time and invitees all show up on the iPhone, while in iCal all the information including the Location field is showing up.

    If it won't charge you probably need to try a different dock to usb cable.  More information on troubshooting this is available here:  http://support.apple.com/kb/TS1591.

  • I have Adobe Reader X on Windows Vista. Why doesn't the Printer for Adobe PDF show up in my Hardware/printers? Or can I add it to the Hardware/Printers?

    I have Adobe Reader X in Windows Vista. Why doesn't the Adobe PDF show up as a printer in my Hardware/Printers? Or can I add it to the Hardware/Printers? And how?

    Adobe Reader - FREE - reads PDF files, prints them, fills forms.
    Adobe Acrobat - $$ - as Reader, and makes PDFs and edits them, sorta, and does a bunch more.
    So if you had Acrobat try and find the license to avoid having to pay again...

  • Why doesn't the sd card or the usb connect to my mac ????

    why doesn't the sd card or the usb connect to my mac plzzzz help meeeeeeeeeee

    The reason no one has replied is that you posted in a little-viewed forum for an obsolete Apple software suite. I am asking the Hosts to move you to the MacBook Air forum.
    Also these forums are NOT chat rooms so you will seldom get an instant answer. No one here works for Apple; we are end users like you who volunteer on a time-available basis to help our fellow Mac users. Patience is required here.

  • HT1853 Why doesn't the iTunes show your device?

    Why doesn't the new iTunes show your device? I want to sync new albums..

    when I try and put songs on it it will sit their for hours saying updating files on zachs iphone preparing to update and it never changes and never updates

  • Why doesn't the PS CC font preview show font families any more? Now i have to scroll through 4,400 fonts every time!

    why doesn't the PS CC font preview show font families any more? Now i have to scroll through 4,400 fonts every time!

    You mean font previews themselves in the list? You can set the size and disable via Type > Font Preview Size.

  • Why doesn't the original document I'm dragging and dropping from one folder to another move?

    Why doesn't the original document I'm dragging and dropping from one folder to another move?
    What's happening is the computer is creating a duplicte of the document and placing it in the new location with a new creation date.  The original document I wanted to drag and drop into a new location remains where it started as the "original" document and the new copy has this little arrow protruding up from the lower left of its icon.
    At first I thought it was an alias, but it's a copy of the document I thought I was dragging and dropping.
    What gives here?
    Steve

    That arrow indicates it is a linik to the original, though. This happens if you wish to drag files, for which you do not have permissions to do this operation, e.g. from Library or System folder. I am pretty sure you do not accomplish this operation from/to folders like Desktop or Documents; if so, there is a problem with your system.

  • Why doesn't my "notes" show within mail sidebar since the Maverick update?

    Why doesn't my "notes" show within mail sidebar since the Maverick update?

    Doing it over Wifi?  I was having the same issue.  I restarted my router and voila. 

  • Why doesn't the ichat icon show up only shows messages and  will not show buddies

    Why doesn't the ichat icon show up? It will only show the messag area. It will not show the people you have as friends to leave offline messages

  • 1. Why doesn't the "Show Duplicates" function ever work?  It's always grayed out.

    1. Why doesn't the "Show Duplicates" function ever work?  It's always grayed out.

    do you have the current itunes? the option is under view "show duplicate items. Maybe you just dont have any duplicates.

Maybe you are looking for

  • Geting "Incorrect client ID.The stub is not connected yet" during deploying

    Hai all,       I am unable to deploy a J2EE application from Deploy Tool. The following trace is comg in defaultTrace.trc.2 #1.5#000D9D9FAF62003C0000000900000F080003FC0472DB309D#1121520967258#com.sap.engine.services.rmi_p4##com.sap.engine.services.rm

  • Adobe Creative Suite 5 & 6 will not open with OX X Yosemite 10.10.1

    To Whom It May Concern: I have an iMac 2013 and OS X Yosemite 10.10.1, Adobe Creative Suite 5 & 6 will not open.  Dreamweaver error message is "To open "Adobe Dreamweaver CS6.app" you need to install the legacy Java SE 6 runtime.  Click more info. .

  • Adobe After Effects Startup Error!

    I just recently installed After Effects on my new PC and when I open the program it says: After Effects error: Crash in progress. Last logged message was: <1204> <GPUManager> <2> Sniffer Result Code: 1 What is going on and how can I fix this?

  • Powerbook detect displays doesn't work on LCD TV.  Does on other TV.

    Hello, I recently purchased a telemprompter which uses an LCD TV with a composite input. (From here on out referred to as teleprompter) I set my powerbook up with the S-video to Composite adapter and hooked it up to my Big TV. The screen automatciall

  • Secure login form as part of a not-secure page

    I know how to make a login page secure via SSL, and I also know how to do a login box on the other application pages that aren't secure. What I can't find out how to do -- or if it is even possible -- is to make a secure (via SSL) login box on a page