java - show one panel after button is clicked and other panel when second button is clicked in the same frame -


I'm building Swing-based application, which consists of two buttons on the bottom -

main interface

now what I want is when clicked the first button it must be like for her actions, as shown below in the same frame label, showing Tekstfild and containing a button panel -

 first button car Rwai

and it will show a panel in the same frame as shown below is when you click one button.

one-button

do not understand it How to implement this interface to provide this event by Headler and Action Listener .. So please let me know how I can store it. Any help would be appreciated .. Thank you

There are approaches 2

    < Li>

    CardLayout based.
    Create all panels (empty, field panels, panel with list) and add them to a container in the container> CardLayout (empty is a default). Swap the cards to show the required cards on the click button.

  1. Entertainment based. Create a new panel with new content on the click button Remove one from the old container and add a newly created panel. Then call:

      container.value (); Container.repaint ();      

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -