Wrong Parent for CardLayout

I have a frame class in which I have added one panel and inside that 3 frames.I want to see the frames depending upon each request,the panle is has CardLayout.When i create an instance of the this class in my main and try to show one of the cards it gives wrong parent for CardLayout error???

You haven't called setLayout on the frame/panel (I'm confused as to your precise setup) to tell it to use the CardLayout.

Similar Messages

  • A CardLayout problem--wrong parent for CardLayout

    I am trying to use CardLayout so that only one of the several panels I crete will be display at a time. However, JBuilder gives me the "java.lang.IllegalArgumentException:wrong parent for CardLayout
    "error. What's wrong?
    package nestedlayouts;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import com.borland.jbcl.layout.*;
    public class Frame1 extends JFrame implements ActionListener{
    CardLayout cl = new CardLayout();
    JPanel cardPanel = new JPanel(cl);
    JPanel welcomePane;
    JPanel balancePane;
    JButton balanceButton = new JButton();
    JButton welcomeButton = new JButton();
    //Construct the frame
    public Frame1() {
    enableEvents(AWTEvent.WINDOW_EVENT_MASK);
    try {
    jbInit();
    catch (Exception e) {
    e.printStackTrace();
    //Component initialization
    private void jbInit() throws Exception {
    Container content = getContentPane();
    content.add(cardPanel );
    welcomePane = new JPanel();
    welcomePane.setLayout(null);
    welcomeButton.setText("Welcome");
    welcomeButton.setBounds(new Rectangle(90, 180, 196, 56));
    welcomeButton.addActionListener(this);
    welcomePane.setName("welcomePane");
    cardPanel.add("welcomePane",welcomePane);
    welcomePane.add(welcomeButton, null);
    balanceButton.setText("ShowBalance");
    balanceButton.setBounds(new Rectangle(154, 181, 196, 56));
    balanceButton.addActionListener(this);
    balancePane = new JPanel();
    balancePane.setLayout(null);
    balancePane.add(balanceButton, null);
    balancePane.setName("balancePane");
    cardPanel.add("balancePane",balancePane);
    this.setSize(new Dimension(509, 333));
    this.setTitle("ATM");
    show();
    //Overridden so we can exit when window is closed
    protected void processWindowEvent(WindowEvent e) {
    super.processWindowEvent(e);
    if (e.getID() == WindowEvent.WINDOW_CLOSING) {
    System.exit(0);
    public void actionPerformed(ActionEvent e) {
    if ( ( (JButton) e.getSource()).getText().equals("ShowBalance")) {
    showPanel(1);
    else if ( ( (JButton) e.getSource()).getText().equals("Welcome")){
    showPanel(2);
    private void showPanel(int num) {
    if (num == 2) {
    cl.show(balancePane, "balancePane");
    else if (num == 1){
    }

    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    //import com.borland.jbcl.layout.*;
    public class bigeyes extends JFrame implements ActionListener{
      CardLayout cl = new CardLayout();
      JPanel cardPanel = new JPanel(cl);
      JPanel welcomePane;
      JPanel balancePane;
      JButton balanceButton = new JButton();
      JButton welcomeButton = new JButton();
      //Construct the frame
      public bigeyes() {
        enableEvents(AWTEvent.WINDOW_EVENT_MASK);
        try {
          jbInit();
        catch (Exception e) {
          e.printStackTrace();
      //Component initialization
      private void jbInit() throws Exception {
        Container content = getContentPane();
        content.add(cardPanel );
        welcomePane = new JPanel();
        welcomePane.setLayout(null);
        welcomeButton.setText("Welcome");
        welcomeButton.setBounds(new Rectangle(90, 180, 196, 56));
        welcomeButton.addActionListener(this);
        welcomePane.setName("welcomePane");
        cardPanel.add("welcomePane",welcomePane);
        welcomePane.add(welcomeButton, null);
        balanceButton.setText("ShowBalance");
        balanceButton.setBounds(new Rectangle(154, 181, 196, 56));
        balanceButton.addActionListener(this);
        balancePane = new JPanel();
        balancePane.setLayout(null);
        balancePane.add(balanceButton, null);
        balancePane.setName("balancePane");
        cardPanel.add("balancePane",balancePane);
        this.setSize(new Dimension(509, 333));
        this.setTitle("ATM");
        show();
      //Overridden so we can exit when window is closed
      protected void processWindowEvent(WindowEvent e) {
        super.processWindowEvent(e);
        if (e.getID() == WindowEvent.WINDOW_CLOSING) {
          System.exit(0);
      public void actionPerformed(ActionEvent e) {
        if ( ( (JButton) e.getSource()).getText().equals("ShowBalance")) {
          showPanel(1);
        else if ( ( (JButton) e.getSource()).getText().equals("Welcome")){
          showPanel(2);
      private void showPanel(int num) {
        if (num == 2) {
          // cardPanel is the parent, balancePane is the child (card)
          // that you added to the parent and now want to show
          // key: parent,     card name
          cl.show(cardPanel, "balancePane");  // error was pointing to this line
        else if (num == 1){
      public static void main(String[] args) {
        new bigeyes();
    }

  • I registered the wrong information for my iCloud account--I misspelled and now want to change it.  Help is needed to delete the account and start anew.

    I registered the the wrong information for my iCloud account--I misspelled the account name.  I accidentally spelled blackberry instead of blackbird.  How can I change this?

    If you don't want to use an alias you'll have to create a new account as you cannot change the @icloud.com address once created.  You'll have to create a new ID, verify the ID, then use the ID to create the new account, and migrate your iCloud data to the new account.
    If you are currently syncing data with iCloud, begin by saving any photo stream photos to your camera roll as mentioned above.  If you are syncing Notes with iCloud, you'll also need to open each of them and email them to yourself so they can be recreated in the new account.  Finally, if you are syncing any iWork documents with iCloud, turn off iCloud syncing in your iWork app settings.
    Then go to Settings>iCloud, tap Delete Account, and choose Keep on My iPhone when prompted.  Then in Settings>iCloud tap Get a Free Apple ID at the bottom, set up your new ID, verify the email address you use to create it by responding to Apple's verification email, then sign in with the new ID to create your new account.  Turn on your iCloud sync settings and choose Merge when prompted to upload your data to the new account.  When you turn Mail to On you will be prompted to create your new @icloud.com email address.  Be carefull to type it correctly as it cannot later be changed.

  • "Invoice History Report "show wrong balance for supplier invoice with USD

    Invoice History Report show wrong balance for supplier invoice with USD Currency
    After I run this report i see in the last of this report there is difference between the supplier total
    USD (Currency ) and the open Balance USD , it is decreased the open balance
    for supplier with 2300 USD with out any reasons
    bellow is some data copy of the report
    ======================================================
    Supplier Site Total: SAR 34,700.00
    Supplier Site Total: USD 39,000.00
    Supplier Total: SAR 34,700.00
    Supplier Total: USD 39,000.00
    Open Balance: SAR 34,700.00
    Open Balance: USD 36,700.00
    *** End of Report ***
    ==============================================
    please advise me from where can this differenc ( 39000 - 36,700=2300 )COMMING
    or it is bug in this report , becuase i compare this report with other report in account payable like
    -supplier open balance letter
    -invoice register report
    -invoice aging report
    all this report give me the amount for supplier USD =39000
    BUT AGIN FROM WHERE THE SYSTEM DECREASED THE AMOUNT TO 36,700
    thanks

    Can you try running Create Accounting For payments just before you run the Invoice History Report and re-check .
    Thanks

  • I used the wrong ID for iCloud on my iphone 5. It is linked to an email that no longer exists. Do I have to delete my iCloud completely and set it up all over again?

    I used the wrong ID for iCloud on my iphone 5. It is linked to an email that no longer exists. Do I have to delete my iCloud completely and set it up all over again?

    You can change the linked email/sign in email for your iCloud and Apple ID accounts from 1 site,
    https://appleid.apple.com/cgi-bin/WebObjects/MyAppleId.woa/
    Go to Manage your Apple ID
    Sign in with your current creditals
    On the left, click Name, ID and Email Addresses
    Under Apple ID and Primary Email Address, click Edit
    Type in your new Email.
    Go to Apple ID, click Edit
    Type in your new Email

  • I forgot my password for my email, then I cant remember my passwordfor my icloud, how can I reset my password If I feed the wrong birthday for my email/account... Now my account has been disables.. please please please please help me

    I forgot my password for my email, then I cant remember my passwordfor my icloud, how can I reset my password If I feed the wrong birthday for my email/account... Now my account has been disables.. please please please please help me

    You will have to call Apple and speak to someone in account security.

  • First I got a wrong password for the network and the application error after a while that I wanted to enter the correct password no longer have access to network settings

    First I got a wrong password for the network and the application error after a while that I wanted to enter the correct password no longerhave access to network settings

    Unfortunately, it says I can't delete anything without the missing password.

  • IPhoto - My iPhoto is not responding. When I click on iPhoto I get a never ending spinning beachball.  I almost think it is looking in the wrong place for the pictures.  How do I redirect it back to the Mac hard drive?

    My iPhoto is not responding.  Whenever I click on the iPhoto icon I get a twirling beachball.  It is as if the machine is looking in the wrong place for the photos.  How can I see where the machine is looking to find out if this is really the problem.  How can I see the path?

    Try this:  launch iPhoto with the Option key held down and create a new, test library.  Import some photos and check to see if the same problem persists. If it doesn't then the problem lies with your current library.
    If that's the case  Apply the two fixes below in order as needed: 
    Fix #1
    Launch iPhoto with the Command+Option keys held down and rebuild the library.
    Since only one option can be run at a time start with Option #3, followed by #4 and then #1 as needed.
    Fix #2
    Using iPhoto Library Manager  to Rebuild Your iPhoto Library
    1 - download iPhoto Library Manager and launch.
    2 - click on the Add Library button, navigate to your Home/Pictures folder and select your iPhoto Library folder.
    3 - Now that the library is listed in the left hand pane of iPLM, click on your library and go to the File ➙ Rebuild Library menu option.
    4 - In the next  window name the new library and select the location you want it to be placed.
    5 - Click on the Create button.
    Note: This creates a new library based on the LIbraryData.xml file in the library and will recover Events, Albums, keywords, titles and comments.  However, books, calendars, cards and slideshows will be lost. The original library will be left untouched for further attempts at fixing the problem or in case the rebuilt library is not satisfactory.
    OT

  • Hello, i am using iphone 4. I made the wrong purchase for ipad.navturk live navigation i bought. just trying to do update. I would ask you to cancel the order. best regards.

    Hello, i am using iphone 4. I made the wrong purchase for ipad.navturk live navigation i bought. just trying to do update. I would ask you to cancel the order.
    best regards.

    There is no one here from Apple or iTunes support. You need to contact iTunes support here:
    http://www.apple.com/support/itunes/contact.html

  • Content Search Web Part displaying wrong Results for anonymous Users.

    HI Forum Group,
    I am getting Wrong results for my content search web part. The requirement is to show the News Description for the selected news item.
    I have a catalog site which stores News like 
    News1
    News2
    News3
    as Items. and i have connected this catalog in publishing site which is anonymous. In the publishing site created one page "News.aspx"added search results webpart which shows all the news item. Added one page "Description.aspx" to show
    description to show the selected news item.
    When ever user selects any news from news.aspx page it will redirected to description.aspx with the selected item ID
    The "Description.aspx" the search results page gets the data based on the URL by QueryString parameter as shown below
    The problem is, if i multiple items to open in tabs all the items are showing the data same as the first selected item, though the article ID is different.
    Thanks
    Sithender

    Hi,
    Thank you for your feedback on how you were successful in resolving this issue.
    Your solution will benefit many other users, and we really value having you as a Microsoft customer.
    Have a nice day!
    Best Regards,
    Lisa Chen
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • HT1277 i have set up an email account on my iPad, but i can not set up same account on iMac or iPhone , it keeps saying wrong password for account, any help please

    i have set up an email account on my iPad, but i can not set up same account on iMac or iPhone , it keeps saying wrong password for account, any help please

    i am trying to use my sky email on imac & iphone 4gs

  • URL links wrongly created for adjucent characters

    The URL links are wrongly created for the following characters after the URL like “)”, “]” etc.
    For E.g. (www.adobe.com), the URL links for adobe is in active for closing parenthesis in PDF which should not have a URL link.
    Any one suggests what would be problem and how to avoid this?
    We are using Acrobat Pro 8.

    Use the Link Tool in Acrobat and create the link.

  • CALCULATE_TAX_ITEM gives wrong values for Scess and HScess in PO Print

    Dear Friends,
    I am working with PO Print in smartforms hare the Fm CALCULATE_TAX_ITEM is gives wrong values for Scess and HEcess if I put the Gate pass (Basic Excise Duty) Manually.
    And one more Issue is as if I check any line item condition taxes than imediatly when I see the print the all line items Scee and HEcess displays same which I have saw.
    If there is a single line item in PO than there is no issue any way.
    kindly suggest to resolve the issue.
    Regards,
    D Tarun Kumar

    Hi,
    I had the same issue, that taxes on invoice tab of PO was not printed correctly on PO form by calling CALCULATE_TAX_ITEM.
    If you want to have the same tax value as komp-mwsbp, that use following form routine call before FB CALCULATE_TAX_ITEM.
    perform j_1b_save_tax_fields(saplmepo) using ekko ekpo lfa1.
    This is used in transaction me23n also.
    Kind regards,
    Tülay

  • I hit the wrong entry for find my ipad, I hit the iphone, how do I get it to correct

    I hit the wrong entry for "find my ipad, how do i get it to correct

    You can log out of the currently logged in account by tapping on it in Settings > Store, and you should then be able to log in with the account that you want.

  • Business area wrongly posted for invoice

    Hi All,
    Business area wrongly posted for invoice.
    The user was posted the invoice with two line items one with posting key 40 for debit and one is 31 for credit vendor, these two line items are posted with different business areas.  and the the invoice is cleared also.
    Could any one please suggest what the above issue affects the business.  what would be the resolution to be done for this.
    Thanks in advance
    Nandha

    Hi All,
    The balances are not matching in fbl3n and fs10n, Due to the above wrong document posted and cleared also.  what is the better way to match the two balances (fbl3n and fs10n).
    Can i reverse the cleared wrong document and reset it in fbra,  if i do this is there any problems occur in production.
    please suggest to tally the balances of fbl3n and fs10n.
    one more thing if i double click on the fs10n the another screen will open in the the total balances are matching in fbl3n and fs10n.
    Please any suggest me to come out of this issue
    Thanks in advance
    Nandha

Maybe you are looking for

  • Report generation: Using only bottom border cell in Excel

    I'm trying to write a report to Excel. for each 2 rows I want the cells to have a bottom border. With the VI " Excel set Cell Color and Border VI" I have 2 options, using inside border and outside border. Outside border seems to be the top and bottom

  • Enterprise not working in SAO manager

    Hi All, I have created a Enterprise Service in the Enterprise Services Builder. I added the source for the Enterprise service in the proxy (XML version) on the back end (ECC 6.04). When I test the service in the back end I get a response with data an

  • Playlist not showing up on iPod

    Recently, I have created playlists in iTunes that are not showing up on my iPod after synching. I create the playlist, click and drag the song from my library into the playlist, update/synch my iPod with iTunes and the playlist doesn't appear on the

  • Find all users who have delegated items to me.

    i need a rule / something, by which i can find all the active delegations assigned to me on my end user screens. It may be from my manager , or from any other user. I checked the user object and noticed that only the person who delegates has the info

  • Image importer fails to import images under iPhoto library folder

    If a JPEG image is located in the default iPhoto library directory (i.e. ~/Pictures/iPhoto Library/Originals/...), mdimporter isn't able to import all the metadata from the image. The error message (when -d2 flag is used) is "Importer indicated failu