Results 1 to 4 of 4
Like Tree1Likes
  • 1 Post By Sierra

Thread: Using CardLayout in Swing

  1. #1
    shiva_1010 is offline Member
    Join Date
    Jan 2013
    Posts
    2
    Rep Power
    0

    Default Using CardLayout in Swing

    I have a requirement where in the first layout say card1 showing some x y z inputs where i capture some inputs
    after i click on the next button i move on to next layout say card2 A B C inputs, once's capturing the inputs from card 1 and card 2 . i need to save it the database.once's it is successfully saved then i need to show the first layout fresh X Y Z which are ready to capture next set of entries.

    eg :
    Card 1 ->on click of next button shows card 2 and finish .
    once we click on finish it should go to the card1 where it can capture another set of the inputs..

    Issuing facing :
    Here when i click on finish still the value are available in the card 1 and card 2

    Please give a suggestion how can i proceed further.
    Do I need to write a function which cleans up the input fields after clicking finish button.

  2. #2
    Sierra is offline AN21XX
    Join Date
    Mar 2012
    Location
    Munich
    Posts
    297
    Rep Power
    3

    Default Re: Using CardLayout in Swing

    Without the code it is difficult to see where your problem lies. A common error is to use the same visual objects for both layouts thus having in fact only one set of cards. But as you describe it that is not your problem.
    So maybe, yes you need either to erase board 1 or you create a new board 1 and discard the old one when you do not need it anymore.
    shiva_1010 likes this.
    I like likes!

  3. #3
    shiva_1010 is offline Member
    Join Date
    Jan 2013
    Posts
    2
    Rep Power
    0

    Default Re: Using CardLayout in Swing

    Thanks for reply sierra.

    Erasing a board or creating a new instance will the components created on the board will exist or gone ?

    I will post code if you want to have look ?

  4. #4
    Sierra is offline AN21XX
    Join Date
    Mar 2012
    Location
    Munich
    Posts
    297
    Rep Power
    3

    Default Re: Using CardLayout in Swing

    Post your code but mind that you apply the forum code tags to make it readable!
    Take a look here please: Guide For New Members

    Well if you abandon your old data it will be gone of course.
    I like likes!

Similar Threads

  1. CardLayout with JPanels
    By Angelo in forum AWT / Swing
    Replies: 17
    Last Post: 12-15-2011, 06:50 PM
  2. CardLayout Help
    By David M. in forum New To Java
    Replies: 4
    Last Post: 08-06-2011, 02:57 AM
  3. Swing - CardLayout and JTable
    By Alex.R in forum New To Java
    Replies: 3
    Last Post: 07-17-2011, 10:14 PM
  4. Help with CardLayout
    By Kyle227 in forum New To Java
    Replies: 4
    Last Post: 05-28-2010, 01:03 AM
  5. Regarding CardLayout
    By adeeb in forum AWT / Swing
    Replies: 1
    Last Post: 06-07-2008, 07:52 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •