This should work but it doesn�t Please can someone tell me why !!!

I have really trid to get this code to work.
Please an some help me with find out why it will not work.
void NewShoeOrderjButton_actionPerformed(ActionEvent e) {
   String check = TitleComboBox.getSelectedItem()+" "+FirstNameJText.getText()+" "+LastNameJText.getText();
   if (check !=null){
    return ;
    else
    String[] options = {"Yes", "Cancel"};
    String d= System.getProperty("line.separator");
    int result = JOptionPane.showOptionDialog(null,
        "Do you really want to add a new shoe order for:"+ d +
        (String) TitleComboBox.getSelectedItem()+" "+FirstNameJText.getText()+
        " "+LastNameJText.getText(),"New Order",
        JOptionPane.YES_OPTION,
        JOptionPane.INFORMATION_MESSAGE,
        null,
        options,
        options[0]);
    switch(result){
      case JOptionPane.YES_OPTION: // Add your code for no
        setFieldsEditable(false);
        break;
      case JOptionPane.NO_OPTION: // Add your code for yes
        // just playing with button
        setFieldsEditable(true);
        break;
  if
    (check ==null){
    return ;
    else{
      JOptionPane.showMessageDialog( null,
                                      "There is no order", "No Order",
                                     JOptionPane.WARNING_MESSAGE);
  }

Thank you for taking the time mate ;)
This is he code changed with your code.
when the title,first &last name is null it still only runs the 1st JOptionPanel and dosn't pass to the 2nd ??
here is the code
  void NewShoeOrderjButton_actionPerformed(ActionEvent e) {
    String check=null;
    if(TitleComboBox.getSelectedItem() != null &&
       FirstNameJText.getText() != null &&
       LastNameJText.getText() != null)
      check=TitleComboBox.getSelectedItem()+FirstNameJText.getText()+LastNameJText.getText(); //the rest of the thing.......;
//then you check "check":
    if(check != null){
      //show the first optionpane
      String[] options = {"Yes", "Cancel"};
      String d= System.getProperty("line.separator");
      int result = JOptionPane.showOptionDialog(null,
          "Do you really want to add a new shoe order for:"+ d +
          (String) TitleComboBox.getSelectedItem()+" "+FirstNameJText.getText()+
          " "+LastNameJText.getText(),"New Order",
          JOptionPane.YES_OPTION,
          JOptionPane.INFORMATION_MESSAGE,
          null,
          options,
          options[0]);
      switch(result){
        case JOptionPane.YES_OPTION: // Add your code for no
          setFieldsEditable(false);
          break;
        case JOptionPane.NO_OPTION: // Add your code for yes
          // just playing with button
          setFieldsEditable(true);
          break;
    }else{
      //show the second optionpane
      JOptionPane.showMessageDialog( null,
                                     "There is no order", "No Order",
                                     JOptionPane.WARNING_MESSAGE);
  }

Similar Messages

  • MP-101 paper jams my MG3100 printer. Manual says it should work but it doesn't. Can someone help?

    Subject says it all.  I got MP-101 paper for my MG3100 printer.  The manual for the printer says this paper should work fine, But the printer fails to pull it all the way through and my printer jams.  Is this a typo in the manual, or is there some way to get it to work?  I set the printer to Photo paper on the actual printer itself, and choose "Matte Photo Paper" on media type inside the printer properties.

    Apple keeps your last 3 backups by making a complete backup of your device at the time of the backup, then keeping any changed files in case you want to restore to an ealier backup.  So it does, for the most part, overwrite the current backup.  However if your backup significantly increased in size it would have to allocate more space in order to maintain the ability to go back to your earlier backups.  An option to try if you don't care about maintaining the ability to go back, is to delete the existing backup.  This would delete the entire backup history and may clear enough space to create a fresh backup.  You wouldn't know unless you tried.

  • Please can someone tell me why I cannot reinstall my upgrade from lightroom 4 (lightroom 3 installed off disc with serial no) my hard drive crashed, and I am trying to get lightroom 3; 4 and 5 back on so that I can link my catalogues and continue work. I

    Please can someone tell me why I cannot reinstall my upgrade from lightroom 4 (lightroom 3 installed off disc with serial no) my hard drive crashed, and I am trying to get lightroom 3; 4 and 5 back on so that I can link my catalogues and continue work. I cannot install lightroom 5 until the upgrades from 4 are on the pc, (lightroom 3 installed off disc but 4 is a copy of the upgrade download I got when I bought it) These serial no's are legit and  are registered under my account with adobe, but it still gives me the Big Red Cross when I put my serial no in! Please can someone help. I am at a loss. Thx Heidi

    Please can someone tell me why I cannot reinstall my upgrade from lightroom 4 (lightroom 3 installed off disc with serial no) my hard drive crashed, and I am trying to get lightroom 3; 4 and 5 back on so that I can link my catalogues and continue work. I cannot install lightroom 5 until the upgrades from 4 are on the pc, (lightroom 3 installed off disc but 4 is a copy of the upgrade download I got when I bought it) These serial no's are legit and  are registered under my account with adobe, but it still gives me the Big Red Cross when I put my serial no in! Please can someone help. I am at a loss. Thx Heidi

  • Please can someone tell me why I am getting this error?

    I want to call a method (setSquare()) when a JLabel is clicked by the user, the following code should work:
    *private void grid11MouseClicked(java.awt.event.MouseEvent evt) {*
    setSquare();
    But I get this error, please can someone tell me what this means? The method is already defined in the class and I have imported javax.swing etc
    Frame.java:181: setSquare(javax.swing.JLabel) in p1.Frame cannot be applied to ()

    drew22299 wrote:
    I want to call a method (setSquare()) when a JLabel is clicked by the user, the following code should work:
    *private void grid11MouseClicked(java.awt.event.MouseEvent evt) {*
    setSquare();
    But I get this error, please can someone tell me what this means? The method is already defined in the class and I have imported javax.swing etc
    Frame.java:181: setSquare(javax.swing.JLabel) in p1.Frame cannot be applied to ()
    As i dont know what that method needs i can't help you there but i do know you cannot leave it blank. Try adding a number/text whatever or null and see what it does. or check the api and take a look what it needs.
    Edited by: deAppel on Oct 31, 2007 10:35 PM

  • Handling events in subvis - think this should work but it doesn't.

    In part of a large project I need to handle key down events, but elsewhere I need to handle them differently and want to be able to dynamically register and unregister them in each location. I also want to be able to put one of the event handlers in a subvi. To quote the Help system, "Dynamically Registering Events: With dynamic registration, you can handle events in a subVI rather than only in the VI where the events are generated."
    ViThatHandlesEvents.vi handles key down events. It uses dynamic event registration to demonstrate that it works (though in this simple example it isn't necessary).
    ViContainingSubviThatHandlesEvents registers key down events and passes this to KeyDnEventHndlrSubVI. I thought it would work but it doesn't.
    Attachments:
    KeyDnEventHndlrSubVI.vi ‏14 KB
    ViThatHandlesEvent.vi ‏22 KB
    ViContainingSubviThatHandlesEvent.vi ‏18 KB

    cebailey wrote:
    Here's a version with Panel > OwningVI > Key Down selected in the nodes that register events. It seems to do what I want. It acts on keystrokes that occur when the cursor isn't even over the parent's window, which is good in my situation. I made these choices by experimenting - is this a good approach, if I want to act on all the keystrokes that occur when the parent VI has focus?
    As you noted, this will have the event structure respond to keypresses whenever the parent VI is active. You can simplify the subVI by simply wiring the "VI Refnum" terminal directly to the Register for Events node. Getting the Panel, and then the Owning VI simply gets you back to where you started.
    That's a valid way of doing it, and I'm assuming that this is intended to be a test case. As you noted you have a large project, so I don't know what your overall architecture is, or how you intend to use this technique, so I can't really say whether it's a "good" approach. It's an approach.
    Say, I should have said this before, but you have to be pretty good to answer the question somebody should be asking, especially in brief forum postings.
    Thanks for the compliment. It's just a matter of seeing a lot of code and a lot of questions. I'm only a teenage pup compared to the real veterans on this board.

  • Re: AGREE to select on agreement contract to start to use the App Store. Please can someone tell me where it is, as I am a novice, but even I thought this would be in plain sight! Please can someone tell me where it is so I can use the App Store?

    Please help me find where the AGREE is that I need to press so I can start using the App Store ?

    You are most welcome

  • Plerase can someone tell me why I cannot reinstall my upgrade from lightroom 4 (lightroom 3 installed off disc with serial no) my hard drive crashed, and I am trying to get lightroom 3; 4 and 5 back on so that I can link my catalogues and continue work. I

    Please can someone tell me why I cannot reinstall my upgrade from lightroom 4 (lightroom 3 installed off disc with serial no) my hard drive crashed, and I am trying to get lightroom 3; 4 and 5 back on so that I can link my catalogues and continue work. I cannot install lightroom 5 until the upgrades from 4 are on the pc, (lightroom 3 installed off disc but 4 is a copy of the upgrade download I got when I bought it) These serial no's are legit and  are registered under my account with adobe, but it still gives me the Big Red Cross when I put my serial no in! Please can someone help. I am at a loss. Thx Heidi

    BrightBluephotograph wrote:
    I cannot install lightroom 5 until the upgrades from 4 are on the pc,
    You don't need to have Lightroom 3 and 4 installed on your computer to install Lightroom 5.  Just install Lightroom 5 and input your serial number for 3 in the previous version box and your serial number for 5 in the upgrade box.

  • HT1766 i have moved from an iphone 4 to iphone 5 and have done a back up of my iphone 4 and restored this back up to the iphone 5 but the apps do not appear to have come across, have I done something wrong?  Please can someone tell me how to move my apps

    i have moved from an iphone 4 to iphone 5 and have done a back up of my iphone 4 and restored this back up to the iphone 5, but the apps do not appear to have come across.  Have I done something wrong?  Please can someone tell me how to move my apps across?

    After you Restore from backup, sync the iPhone.

  • I have just changed my ISP and they have informed me that i have to change the IP address on my time capsule. Please can someone tell me how todo this? Thanks

    I have just changed my ISP and they have informed me that i have to change the IP address on my time capsule. Please can someone tell me how todo this? Thanks

    This should really be unnecessary but anyway..
    If you mean the internal IP of the TC, the it can be changed by changing the dhcp settings.. which is weird.
    It looks a bit different in the v6 utility but is easy to do..
    See the DHCP beginning address is split into sections.. change the front section from 10.0 to 192.168
    Then update the TC.. then you will need to change everything on the network as the IP will need to change.. I recommend you simply turn everything off and then on again in correct order.. modem.. TC.. clients. 2min gap.

  • After i updated my firefox from 3.16 to 4.0.1, have some websites i can't load, and they showed: " database error" but b4 i never got this problem. Can someone tell me why ?

    after i updated my firefox from 3.16 to 4.0.1, have some websites i can't load, and they showed: " database error" but b4 i never got this problem. Can someone tell me why ?

    Nothing is working and I can't find the Roboform toolbar. Your lack of direct support is really irritating- a live chat at least would be helpful.

  • Ok I have an fully upgraded iPad 2 and the volume button don't work but it do with headphones can someone help

    Ok I have an fully upgraded iPad 2 and the volume button don't work but it do with headphones can someone help. I try to go to settings and the volume won't go up there either I have the home button gesture and still the same. I try resting my iPad and nothing no sound work unless I have my headphones in. Do anybody know how to fix this

    Did you try rebooting the iPad? You will need to have some battery power for this.
    Reboot the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider - let go of the buttons.
    This may be helpful
    iPhone, iPad or iPod touch: Not responding or does not turn on
    Frozen or unresponsive iPad - Apple
    iPad: Unable to update or restore

  • HT201514 Please can someone tell me what is going on when I get this message, The backup disk image "/Volumes/Data/Carole Wilson's MacBook.sparsebundle" is already in use.  Latest successful backup: Yesterday, 2:04 PM

    Please can someone tell me what is going on when I get this message for the Time Capsule?

    Yes, this is because Lion or ML which you are using have lousy networking.
    The trick is simply reboot the TC..
    Or on Lion use the 5.6 utility and disconnect all users.
    For ML sorry.. Apple decided you don't need that function any more!!.
    http://pondini.org/TM/Troubleshooting.html
    Read C12.. I think C17 is also related.

  • Can someone tell me why the Yahoo mail server (IMAP) keeps requesting my Yahoo email password and says it's incorrect?  Yahoo is my Mac mail server.  This has happened before, but this time I can't get it to 'Cancel'

    Can someone tell me why the Yahoo mail server (IMAP) keeps requesting my Yahoo email password and says it's incorrect?  Yahoo is my Mac mail server. This has happened before, but this time I can't get it to 'Cancel'.

    You will have to contact Yahoo Support.

  • Contact from my phone book just disappeared.dont know how ..and it happen second time in 1 month time. Apple customer service in India is crap... Sorry to say but 700 contacts got disappeared.can someone tell me how to get this contacts back on my phone.p

    contact from my phone book just disappeared.dont know how ..and it happen second time in 1 month time. Apple customer service in India is crap... Sorry to say but 700 contacts got disappeared.can someone tell me how to get this contacts back on my phone.plz

    the same problem happened to me also, i felt that while playing hay day, if some calls came in between and if i answered the call, the setting of all the icloud items turns off. (i have backup of all the items on icloud), after deleting the account and making settings of mail, contact, calander etc on on mode and after rebooting the phone, it again download from icloud server. but it is just a headache. do not know how to handle this.

  • Can someone tell me why Apple cannot produce a Scabble game that works on Mountain Lion. So frustrated that this is not happening with all the technology available.

    Can someone tell me why Apple cannot produce a Scabble game that works on Mountain Lion. So frustrated that this is not happening with all the technology available.

    The only companies that can make a Scrabble game are the companies that own the rights to the game; Hasbro owns the rights in the US & Canada, Mattel owns the rights outside of the US & Canada.
    You need to be speaking to those two companies.

Maybe you are looking for

  • Expense Report Expense Program errors in R12.1.2

    Hi gurus, I am trying to run the Expesne Report Export Program and it is erroring out the Reject code is (INCONSISTENT SUPPL SITE).Here we have to Sources 1:XpenseXpress 2: EXTAMEX and when i run the export program for source 2 the invoices are getti

  • Create sales document with reference document

    Hi Experts:                 In the case of create sales document ,i set that create sales order with reference a billing document.                 But i have a problem,the Pricing procedure in billing document is A, after coping from it,the sales doc

  • App store browser on iPad loses it's place

    While browsing the app store, after viewing an app's detail, the browser frequently starts over at the 1st screen of apps in the category - rather than where I was previously browsing. This is very frustrating - especially in a category of thousands

  • Report File Path Directory

    How can i get the definitive report file path in teststand V3.0

  • Tax values get refershed to 0 in item & header condition.

    Hi All, The routines have been developed for the tax values in the PO. The values are getting stored in the KONV-KWERT fields. But if i go in change mode of that PO No. in ME22N the tax values get refreshed to 0 in item & header conditions. & the sam