Changing panels on a frame depending on what the user clicks

I'm making a small application with a JFrame and some JPanels.
When the application starts a start panel is added to the frame where the user can press two buttons. If he presses a button, then a new panel must be painted on the frame. In the new panel there is a button for going back to the starting panel.
How can I accomplish this changing of panels? How does one panel give control to another panel? How can I let the frame control everything (if I should do that)?

I guess just use CardLayout, CardLayout will solve your problem

Similar Messages

  • When I upgraded from v4 to v5 my bookmarks was lost. I do have the one that is in the firefox toolbar. Apparently I had a bookmarks add-on. V5 changed my browser how can I determine what the program was and if the bookmarks are still there?

    When I upgraded from v4 to v5 my bookmarks was lost. I do have the one that is in the firefox toolbar. Apparently I had a bookmarks add-on. V5 changed my browser how can I determine what the program was and if the bookmarks are still there?

    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance).
    *Do NOT click the Reset button on the Safe Mode start window or otherwise make changes.
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes
    Websites remembering you and automatically log you in is stored in a cookie.
    *Create an allow Cookie Exception to keep such a cookie, especially for secure websites and if cookies expire when Firefox is closed.
    *Tools > Options > Privacy > Cookies: Exceptions
    In case you are using "Clear history when Firefox closes":
    *do not clear Cookies
    *do not clear Site Preferences
    *Tools > Options > Privacy > Firefox will: "Use custom settings for history": [X] "Clear history when Firefox closes" > Settings
    *https://support.mozilla.org/kb/Clear+Recent+History
    Note that clearing "Site Preferences" clears all exceptions for cookies, images, pop-up windows, software installation, and passwords.
    Clearing cookies will remove all specified (selected) cookies including cookies that have an allow exception and cookies from plugins.

  • Re Tools Panel.  I cannot find out what the icons mean.  I have Elements 7 book, but it does not tel

    Re Tools Panel.  I need to know what the icons stand for.  I pass my cursor over them but it does not pop up & I have the book Elements 7 but cannot find it in there.  EALJ

    Hi EALJ,
    This is from the photoshop elements 7 help manual:
    (click on the screenshot below for a larger view)
    If you not seeing the Tool Tips you should verify that Show Tool Tips is checked in Edit>Preferences>General>Show Tool Tips

  • Generating a PDF of what the user sees, and sending it as a binary stream to the server

    Hi All,
    On the final page of our Flex app, we allow the user to print out a copy of everything they've entered for their own records.
    I'm wondering if there is a way for me, programmatically, to generate a PDF document that is the same as their printout (I pass a particular container to the "print" button I've got for the user), and send those bytes back to the server.  We can store this PDF along with all the rest of their data, and it would be useful as a "snapshot" of exactly what the user saw when they submitted their application.
    I'm looking into Flex PDF generation, but so far haven't gotten this figured out.  I thought some folks here might be able to point me in the right direction.
    Thanks!
      -Josh

    Here is how you can take a snapshot.
    import mx.graphics.ImageSnapshot;
    import mx.graphics.codec.IImageEncoder;
    import mx.graphics.codec.PNGEncoder;
    import mx.utils.Base64Encoder;
    private function uploadImage(rSource:IBitmapDrawable):void
                        var tBitmapData:BitmapData = ImageSnapshot.captureBitmapData(rSource);
                        var tEnc:IImageEncoder = new PNGEncoder();
                        var tBA:ByteArray = tEnc.encode(tBitmapData);
                        var tB64:Base64Encoder = new Base64Encoder();
                        tB64.encodeBytes(tBA);
                        // send tB64.toString() using POST to the server to save the image.
    // call
    uploadImage(this) // where parameter is an object to get the snapshot of. Can be anything including Application. ("this" in my case).

  • Add WHERE criterias in addition to what the user enters on search page

    Hi,
    This may be a simple problem, but I have not been able to solve it.....Is there a way for me to code another search criteria in addition to what the user enters?
    I'm trying to create a simple search page. Basically, user logs on, i get his acoount number and save it in a variable. Then whatever the user's search criterias are , I want to add "AND ACCOUNT = ???."
    I've tried:
    In the processRequest, retrieve his account number using a VO, stored account number in variavle x and then call a initQuery(x) for the VO to get only the rows that he should be able to see. Problem A: I get 'SQLStmtException' when I test the page by trying to do a Simple Search. So to fix that, in the VOImpl, I added these two calls -- setWhereClauseParams(null); setWhereClause(null); -- after the executeQuery(). After I did this, ran into Problem B: the user could search any record that wasn't associated with his account.
    I also tried to dynamically create the vo using createViewObjectFromQueryStmt("Select * from table where account = " + x) but was not successful. The page didn't render and I received a ClassCastException similar to this thread -- Re: How to Create OAViewObject programatically
    I'm new to OAF and would appreciate any pointers on how to implement this.
    Thanks,
    LL

    Hi,
    I assume that you haven't tried the following steps..if you have and still get an error, give us the SQL statement error that is coming up. If I misunderstood your requirement, could you elaborate.
    I assume that when the user logs in you get the account number automatically.
    You could define the VO to have the following where condition 'WHERE ACCOUNT=:1'.
    Then you set the account id from the user using setWhereClauseParams(0,accountid) and call executeQuery. This would limit the result to that user.
    This will work in addition to any other search fields that might have been used in the query.
    For e.g with just the account id the sql that will be fired is
    Select attribute1, attribute2....from Tablexxx where account = :1
    Any other user search criteria given in the page will result in a ssql query like the following
    select * from (Select attribute1, attribute2 ...from Tablexx where accoount = :1) where newattribute like `%xx`
    Hope this helps. Let us know if you still have issues.
    Thank you,
    Arun

  • Prompt the error message according to what the user had entered.

                   for(int i = 0; i<3; i++){     
                        do{                              
                             try{
                                  System.out.print("Input range for Question " +(i+1) +": ");     
                                  inputQuestionRange = Integer.parseInt(input.nextLine());
                             }     catch(NumberFormatException e){
                                       System.out.println("Error: Please enter a valid number.");
                                  if(inputQuestionRange > 5 || inputQuestionRange <2){
                                       System.out.println("Error: Please Range enter between 2 to 5.\n");
                        }     while(inputQuestionRange > 5 || inputQuestionRange <2);     
                             question[i] = new int[inputQuestionRange];
                   }//for rangeResult:
    Input range for Question 1: 2d
    Error: Please enter a valid number.
    Error: Please Range enter between 2 to 5.
    Input range for Question 1:
    I would like to prompt the error message according to what the user had input.
    However when user input *2d* it just print both error message as it went into the if-else block. how can i skip the if-else block ???

                   //Set Range
                   for(int i = 0; i<3; i++){     
                        do{                              
                             try{
                                  System.out.print("Input range for Question " +(i+1) +": ");     
                                  inputQuestionRange = Integer.parseInt(input.nextLine());
                                       if(inputQuestionRange > 5 || inputQuestionRange <2){
                                            System.out.println("Error: Please Range enter between 2 to 5.\n");
                                       }     else{
                                                 System.out.println("OK");
                             }     catch(NumberFormatException e){
                                       System.out.println("Error: Please enter a valid number.");
                        }     while(inputQuestionRange > 5 || inputQuestionRange <2);     
                             question[i] = new int[inputQuestionRange];                    
                   }//for rangeResult:
    Input range for Question *1*: 22
    Error: Please Range enter between 2 to 5.
    Input range for Question *1*: d
    Error: Please enter a valid number.
    Input range for Question *1*: 3
    OK
    Input range for Question *2*: ww
    Error: Please enter a valid number.
    Input range for Question *3*:
    Hi, thank you for your help, i just realize another problem.
    why does my Question number increment to 3, it should remain as 2 when i request for user input again. i try many ways by altering the for loop, when i insert the try & catch block in a while(!invalid), it just loop forever and crash. How can i solve this ?
    Edited by: metaroot on Feb 18, 2008 1:55 PM

  • What's an easy way to determine what the user typed is a date object?

    What's an easy way to determine what the user typed is a date
    object?
    Thanks!

    Thanks for trying. Sorry for not being clear. but I figured
    it out.
    the user can type in a date, or a name to search. The format
    they type in date has to be in mm/dd/yyyy.
    I was able to use:
    if (new Date(textEntered).toString()=="Invalid Date") {
    // not a date entered
    else {
    // a date is entered
    To do what I need to do.
    Thanks.

  • How to change company logo dynamically using login information of the user in flex4 CSS styl method?

    hi all,
    I am doing mxml flex4 web application. i am using a login in my application. this login for multi user  purpose.
    My need is when a user login using his username and password his company logo should show the top of my application and his copyright details show the bottom of my application
    if another user login means his company logo and copywrights should show in my application.
    This logo and copyrights details should change dynamically based on the login information.
    I want to create this using CSS file (skins and sparks)
    How to do this,i am struck in this place,
    Looking for useful and helpful suggession or snippet code,
    Thanks in advance,
    Cheers,
    B.Venkatesan.

    If the user is logging in, presumably you are having the user hit a back end web-server and database and using something like Blaze to connect? Right?
    I personally would not do this with CSS. I would map the company icons to the users in the DB, retrieve the proper company icon and then pass it down (or embed it in the app) when the user logs in. Then, I would just set the source of the icon to be what I passed down:
    Add your image where you want it to go:
    <s:Image id="emptyImage" x="locationx" y="locationy".../>
    Then in your ActionScript, when the user logs in and you know what company the user belongs you could do this:
    private function loginUserBlazeResponse(resultEvent:ResultEvent):void {
    var bytes:ByteArray = ByteArray(resultEvent.target);
    emptyImage.source = bytes;
    addElement(img);
    img.visible = false;
    img.addEventListener(FlexEvent.UPDATE_COMPLETE, imageLoaded);

  • Recording what the user do

    hi,
    i'm thinking about an application which can record the actions on the screen and save this as an .mpg file.
    The only problem is, how i can get images of the screen so i can make a video out of it.
    I thought about making screenshots and save this images, but is this a good solution or do you know a better one?
    Pls help me,
    thx,
    thomas

    you're right... not only is it not necessary fast, but it'll consume major memory. If you want to provide playback, then I would suggest recording the state of the application in time slices (you could even record the mouse position and draw a mouse pointer later). During playback, you just iterate through the states and render what the game looked like at that time slice.

  • Recording Actions what the user do and save this as .mpg

    Hi,
    Is there a possibility to record the actions on the screen and save this to an .mpg or .avi file?
    I think about an application which can record for example games so that the user can watch this game lalter again.
    Can i make this with JMF and if it is so, how can i make this?
    thx

    you're right... not only is it not necessary fast, but it'll consume major memory. If you want to provide playback, then I would suggest recording the state of the application in time slices (you could even record the mouse position and draw a mouse pointer later). During playback, you just iterate through the states and render what the game looked like at that time slice.

  • Oracle.DataAccess dependency issue: whats the other dll?

    Hi
    My client programm complains that it cannot load the Oracle.DataAccess assembly but I the dll is within the execution/installation folder of the programm. Maybe I should mention that I removed Oracle.DataAccess from the Global Assembly Cache (because of ODT 11 and ODT 10 issues). When I did that, I remember that there were 2 dlls removed but I dont know the second one (which probably is the depending one).
    Can someone tell me the name of this dependency-dll and where to find it?
    Its kind of urgent :)
    Thanks in advance

    There's a lot of DLLs involved because ODP.NET relies on the Oracle client being installed as well.
    You can do it the hard way and download "depends.exe" (Dependency Checker) from a windows tools site, or you can just reinstall ODAC. It's probably easier and safer to just install ODAC.
    If you want to create a custom deployment, checkout the "XCopy" version of ODAC. It sort of sounds like that is what you are looking for.

  • Live Corners - Change one corner individually - I've tried what the tutorials say to do

    Live Corners: I can't change only one corner at a time when holding alt/option while clicking (or when I click and drag) the widget with the direct selection tool. Instead it changes all the corners at once. How do I get it to change one corner individually?

    Agreed, the steps in the video cannot be reproduced faithfully in the current software (18.0.0). Granted when he talks about changing the radius of a corner independently he selects a control point. Earlier however he appears to change a single corner style with the entire shape selected. This I cannot do.
    As far as I can tell there is no reason why the operation ALT/OPT + manipulation of the corner widget can't result in single control of that radius. The ALT/OPT key along with the white arrow tool doesn't seem to be any different than with no modifier key.
    The tool is a very good idea on the whole but the intuitive approach should be the one that works.

  • I make changes on the calendar of my MacBook Pro but the changes do not take and revert to what the entry was prior.

    For the past week or so, I have made changes to the calendar on my MacBook Pro. The changes do not "stick" on my MacBook calendar and do not sync with any other device (iPhone or iPad). I just can't figure this out. Anyone have any suggestions?

    By everything, I am assuming you have tried resetting the SMC (http://support.apple.com/kb/HT3964) and PRAM (http://support.apple.com/kb/ht1379). If you haven't tried this yet, please do!
    See the following support document as well: http://support.apple.com/kb/TS1367.
    The update you're talking about was the firmware update. Hopefully resetting the PRAM gets you up and running. Try resetting it 3 times in a row (hold the keys down until you hear 3 startup chimes).
    Message was edited by: adamb529

  • My iphone has an alert that I cannot find to change in settings. I dont know what the alert is for

    My I phone has an alert sound (duck) that goes off all the time.  I cant find in settings under SOUNDS a corresponding alert sound of DUCK associated with any ringer or alert. Its making me crazy!  Its not listed under sounds where else could it be?

    must be coming from an apps. Try closing all the apps

  • HRPAD00INFTY - How to determine what action the user took (IN_UPDATE)

    Greetings, Experts.
    I've been asked to modify an existing BAdI for infotype 0167. The existing code is in method IN_UPDATE.  FYI, we have to use this method (as opposed to, say, AFTER_INPUT) since we have to make sure the user completed the operation as we're modifying data in another infotype based on their action.
    As such, the  logic depends on what the user is doing, i.e., inserting, updating, delimiting or deleting a record. I was testing different scenarios in PA30 to see what the value of IPSPAR-ACTIO would be and got some puzzling results.
    For example, I used the Edit->Copy feature in PA30 to copy and then delimit an existing record and was expecting an ACTIO of "LIS9" (Delimit) but it was "MOD". Similarly, I used the trashcan to remove an existing record and got a "MOD" operation. Finally, I deleted another record the same way (trashcan icon) and this time it was "LIS1" which I found stupefying since that's not even a valid value according to the DDIC for data element ACTIO.
    I can't seem to get a consistent way to determine what the user is doing. What is the best practice?
    Thanks.

    Hi Steve,
    You can  try with IPSYST-IOPER Parameter Which is Showing the Right Values .
    Regards,
    Kishore.S

Maybe you are looking for