Help - Swapping of Two Panels triggered by JButtons in two separate Panels

Problem: How to swap two Independent JPanels? Is it really possible?
Some Information:
Scenario 1:
This implementation is easy if both panels was inside a Master Detail Panel (Add the first Panel and hide and remove if the Second Panel is triggered)
//Sample Coding
private JButtonTrigger_actionPerformed(ActionEvent e){
FirstPanel.setVisible(false);
FirstPanel.remove( );
MasterDetailPanel(add.SecondPanel, null);
SecondPanel.setVisible(true);
Note: Assuming that the JButton was placed on Master Detail Panel
Scenario 2:
This is also easy if both are JFrames. In this sample code, This JFrame is calling another JFrame named Main( )
//sample coding
JFrame frame = new Main( );
//Dimension screenSize declaration
//getScreenSize( );
//Getting the height and the width
//Setting the location
frame.setVisible(true);
*** Now this is my problem, Is it really possible swapping two INDEPENDENT JPanels?
Given
1. There are two JPanels, (JPanelFirst, and JPanelSecond)
2. JPanelFirst has JButton named "CallSecond", placed below of it.
3. JPanelSecond has JButton name "CallFirst", placed below of it.
4. "CallSecond" JButton must call JPanelSecond and "CallFirst" JButton must call JPanelFirst when the user presses the button.
5. The principle is swapping.
I have tried to implement this one but the swapping of JPanel does not work properly. I really need your help (sample code or sites recommended) and advice if it is really impossible to implement so that I have an alternative. Thanks for your time reading this.

http://java.sun.com/docs/books/tutorial/uiswing/layout/card.html

Similar Messages

  • Two digital triggers

    Hi!,
    I´m in need for a little help. My problem is that I´dont know is it possible to use two digital triggers simultaneusly in 6225-daq. I try to do two same tests at same time. PFI4 line should be as a trigger for a line ai20 and PFI5 should be as a trigger for a line ai52. PFI4 and PFI5 lines get rising edges almost simultaneosly but, you can´t be sure which one happens first.  
    Program should be able to tell if PFI4 and/or PFI5 lines get rising edge at all. If example PFI4 line gets rising edge and PFI5 line doesn´t,program needs to acquire data from ai20 when PFI4 rises. if PFI5 line doesn´t rise in 0,5 s program should not acquire data from ai52 and it should give for example boolean value or something so you can write to file that test to this other device failed.
    I can use digital triggers and all is just fine when I get rising edges to trigger lines but when not, program falls.
    Attachments:
    sama trig linja eri measure linjat 1_11_2005.vi ‏110 KB

    Hi Jetfire,
    do you know the difference between BMP and JPG?
    Size! (And that's the reason BMPs are banned in this forum.)
    Just renaming a file doesn't change the dataformat. Please attach real JPGs (or even better PNGs) next time!
    Jetfire created a related thread, now with a VI instead of a picture...
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Can you please help me by saying me how can i join two different picture to make it as one picture.??

    Hi Sir/ Madam,
       My name is Rishav and I am facing some problem with my Photoshop CC. Actually I have a question. If you guys could help me out i will be very obliged. The quest in "Can you please help me by saying me how can i join two different picture to make it as one picture.??"

    Maybe you should post over at
    Photoshop for Beginners
    or start with the "Get Started" section of the Help:
    Photoshop Help | Photoshop Help
    And your question
    Can you please help me by saying me how can i join two different picture to make it as one picture.??
    does not seem particularly specific – do you want to simply combine two images as they are, do you want to clip elements from the one and insert them into the other, …?
    Could you post (lores of) the images and explain what you intend to achieve?

  • HT2905 My itunes looks nothing like the examples in this tutorial.  I do not have "display exact duplicates" or "date added".  Can someone please help me remove duplicate songs?  Also, I downloaded two audio books and they are showing up in my song list.

    My itunes looks nothing like the examples in this tutorial.  I do not have "display exact duplicates" or "date added".  Can someone please help me remove duplicate songs?  Also, I downloaded two audio books and they are showing up in my song list. Why???

    'Show duplicates' is now under the 'View' menu. To see the 'Date added' column go to 'View options' from the 'View' menu and check it in the section under 'Stats'.
    Click an audiobook once to select it and hit command-i (Mac) or control-i (Windows). Go to the 'Options' tab and set 'Media Kind' to 'Audiobook'.

  • I have two iphone wich are protected by two different password ! but when i woke up today ! i'v found that my two iphone ( iphone 5 et iphone 4 ) refuse my passwords of 4 numbers i have important data and i dont want to lose please help me ! thank you !

    i have two iphone wich are protected by two different password ! but when i woke up today ! i'v found that my two iphone ( iphone 5 et iphone 4 ) refuse my passwords of 4 numbers i have important data and i dont want to lose please help me ! thank you !

    If you forgot (or don't know) your passcode, restore the device from backup on the last computer it was synced with when the passcode was turned on... this will remove the passcode. If you do not have access to the last computer it was synced with, or you don't have a backup, you will have to force it into recovery mode & restore as a new device.
    See this for more info... http://support.apple.com/kb/HT1212

  • I have two apple ids somehow, probably from two mobile and two computers - how do I merge them into one account so they all work with iCloud?

    Somewhere, somehow, between two mobile and two macs, I ended up with two apple ids. I figured that this was the root of my problem to syncing. So, I am syncing Mail, Contacts, etc through the one account that I bought storage on this year in iCloud. I want to merge the two accounts, since many of my apps were purchased with my other id. Apparently, Keynote will not merge files since the app was bought with the second id, not the id I am using for icloud.
    What to do??? I read, in the forums, that I am definitely not alone. I always had the id I used for the Apple Store to buy iTunes items, and then apps. The other id, that I am using for iCloud was based on my iDisk id, and apparently I set up as a separate account. The much failed iDisk account appears to be the one that I wish I never got involved with. Should I feel the same way about iCloud. If I cannot merge the two APPLE accounts from the same person (ME!!!), then many dropbox really is the answer for my file sharing needs.
    Please help me decide.

    To begin with, I would like to try to explain Apple's confusing nomenclature in regard to iCloud.
    Apple have called the whole cloud thing iCloud, there are a number of features under the iCloud umbrella, some of which require their own login. iTunes is one of these, another is what Apple have unfortunately also called iCloud too.
    You can use the same Apple ID (account) to login to both iCloud and iTunes, but you don't need to and often users will login to each service using a different ID.
    The part that you need to remember is that the services available when you log into iCloud are completely different and unrelated to those when you log in to iTunes. Your iCloud login enables mail, contacts, calendars, find my phone, Back to My Mac, Documents & Data sharing and photostream, it does not affect any of your iTunes services.
    To avoid confusion when discussing your problem, when I mention iCloud, I am referring to the services under the iCloud login, Whereas I will refer to the whole cloud thing as The Cloud.
    To go back to your question; you cannot merge accounts, but perhaps using one account for iCloud and the other for iTunes will resolve the majority of the reasons you needed to merge to begin with.

  • Hello, I want to perform a simple task. I have two Adobe ID accounts linked to two different email addresses. One account i do not want to use anymore but it is linked to my main email account. the account i do not want anymore is still in its free stage

    Hello, I want to perform a simple task.I have two Adobe ID accounts linked to two different email addresses. One account i do not want to use anymore but it is linked to my main email account. the account i do not want anymore is still in its free stage and i have not purchased anything with it. My other Adobe ID account is linked to an email i rarely use and don't particularly want to use. i have tried changing the linked email account to my regular one i use. But it obviously does not allow me because of it already being linked to my other non used obsolete Adobe ID account. Is there any solution to this?? Please help.

    Adobe contact information - http://helpx.adobe.com/contact.html may help

  • Can we perform two actions with one button with two clicks one after other?

    Sir,
    can we perform two actions with one button with two clicks one after other?
    I want that when I click an Add Button first time it add data to the database and when I click again this button it clear the form data to empty fields.
    Regards
    Tanvir

    In code it should be easy.
    The following code adds a button called butman with a text "ADD".
    It then registers a listener that will be called if the button is clicked.
    This listener then calls the runAddData method if you clicked on butman while it contained the "ADD" text and it will call the runClearData method otherwise.
    Therefore it will swap the button's functionality between ADD and CLEAR on every click.
    final Button butman = new Button("ADD");
    butman.setOnAction(new EventHandler<ActionEvent>() {
              @Override
              public void handle(ActionEvent t) {
                        if (butman.getText().equals("ADD")) {
                                  butman.setText("CLEAR");
                                  runAddData();
                        } else {
                                  butman.setText("ADD");
                                  runClearData();
                        } // END IF-THEN
              }});I hope this is what you wanted.
    Some extra food for thought.
    You might want to run the ADD and CLEAR methods in their own threads so that it can run in the back ground, without slowing down your user interface.
    I also like to rather reuse one button for multiple functionality in stead of making an application with hundreds of nodes only used rarely with masses of code to show and hide them if needed.

  • CS6 Illustrator panel auto-collapses when expanding a different panel

    Hi,
    Can anyone explain how to stop a panel from auto-collapsing when expanding other group panels?
    For example: if I have 'layers' panel expanded and I click the 'color' panel, the 'layers' panel collapses to icon. (I have disabled 'Auto-Collapse Iconic Panels' but it still doesn't allow me to have 2 different panels expanded at the same time)
    Thanks

    Double click on the green square and the dialoge box will come up. If you double click on the red square it will just make the name of the layer editable in the pallette. I hope this helps.

  • Two main windows in smartform or two loops in one main window?

    Hello All,
    I have requirement in smartform where i want to print two diffrent data header and item data in the same page.
    and in between these two data i want one template to be printed for item data .
    Smartform is giving me error if i use two main windows
    if i use two loop nodes in the main window thn how to restrict the data getting over flowed to template(item data)
    scenario is
    header data****
    **item header**
    item data****
    Pls comment....
    Regards,
    Sunny

    As main window can only be one, so try it this way:
    Under main window create a TEXT1 for header text( first header) than a LOOP1 for looping the header table, under that first create a TEXT2 for header data, than below it create another TEXT3 for header text ( Second header), than below it add a LOOP2 for looping item table and in that add a where condition than under it a TEXT4 for item data .
    MAIN_WINDOW
        TEXT1                                     " first header
        LOOP1                                    " header table
            TEXT2                                 " header data
            TEXT3                                  " Second header
            LOOP2                                " item table with where condition
                TEXT4                             " item data
    With luck,
    Pritam.

  • In iPad 1 ios 4 may have two ipad Apps the same from two accounts itunes

    In iPad 1 ios 4 may have two ipad Apps the same from two accounts itunes one free other paid account, hence one free App and another paid App the same App?

    If both accounts are authorised on your computer's iTunes (Store > Authorise This Computer) then you can download the books from both accounts to there (download the books from one account, then sign out of it via Store > Sign Out, log in with the other account via Store > Sign In and download the books from the other account), and sync them over to the iPad's iBooks app via the Books tab.
    Or you might be able to sign out of your account on the iPad by tapping on it Settings > Store and sign in with the other account and download the books from that account - I think that it should work, but it's not something that I've tried so I'm not 100% sure that it will

  • My wife and I decided to both buy Iphones do I put them both under the same apple ID, or do I create two different apple ID's and two differnt icloud accounts?

    My wife and I decided to both buy Iphones do I put them both under the same apple ID, or do I create two different apple ID's and two differnt icloud accounts? We want to be able to share my itunes library on both our phones and sync our calendars, but I don't want every update and reminder that my wife puts in her phone and I know she doesn't want every reminder I put in my phone.

    What you need to do is both use the same Apple ID for iTunes content, but separate Apple ID's for everything else. So, you keep your existing Apple ID. If not a verifiable email address, you will need to create a new Apple ID for yourself. You also create an Apple ID for your wife, again a verifiable email address. You use the existing Apple ID for all iTunes content. The new Apple ID's for iCloud, iMessage, FaceTime, etc. Here's how to create an Apple ID:
    https://appleid.apple.com/cgi-bin/WebObjects/MyAppleId.woa/wa/createAppleId?loca lang=en_US
    Use multiple devices on one computer:
    http://support.apple.com/kb/HT1495

  • HT4314 I have 4 iPads and one apple Id. Two the devices record clash of clans and dragonvale individually and the other two are tied to the other two. Drives my kids nuts. How do I fix this?

    I have 4 iPads and one apple Id. Two the devices record clash of clans and dragonvale individually and the other two are tied to the other two. Drives my kids nuts. How do I fix this?

    Also, I'd prefer to keep the same ID on both so I will keep access to my calendar/contacts/etc on both devices.  Would I be able to share reminders and voice memos and the like as well?  And how often would they update each other?  If I edit a contact on the 5, and the 4 is in wifi, assuming they're both on my same ID, will the contact update on the 4? 

  • HT204053 If I have set up my Mac with two different users,  can I use two different Apple IDs on the same Mac?

    If I have set up my Mac with two different users,  can I use two different Apple IDs on the same Mac?

    Each user account may have its own Apple ID.

  • How do I combine two one page documents into one two page document?

    How do I combine two one page documents into on two page document?????

    Menu > View > Show Thumbnails > Click on the thumbnail > Copy > Paste into the Thumbnails of the 2nd document
    Peter

Maybe you are looking for