Results 1 to 2 of 2
  1. #1
    ark
    ark is offline Senior Member
    Join Date
    Apr 2015
    Posts
    288
    Rep Power
    6

    Default Complex if to test multiple values

    Untill now – everything works well. I do not know how would be situation when linked to jar.
    Yesterday I asked about if .. break, but it should be like if…return.
    Java Code:
    if (JF.ind==0) {JF.label.setText("You should wright file");
    return;
    };
    Really I do not want to create new thread so want to ask how to check briefly if (JF.ind==0,1,2,3…) should I use additional (JF.ind==1), or there is something shorter like
    if (JF.ind=={0,1,2,3}).

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    20,003
    Rep Power
    33

    Default Re: What is the sense of invokeLater()

    check briefly if (JF.ind==0,1,2,3…
    Test for each value in a subexpression and use an OR to connect the tests into a single expression
    Another way if the values are contiguous is to test >= lowest and <= highest value.
    Last edited by Norm; 11-11-2015 at 12:50 PM.
    If you don't understand my response, don't ignore it, ask a question.

Similar Threads

  1. Very Compact Test For Any of 4 Values Being Null.
    By augustas656 in forum New To Java
    Replies: 1
    Last Post: 04-08-2014, 11:25 AM
  2. Replies: 4
    Last Post: 03-01-2013, 01:32 AM
  3. if/else test if y is a multiple of z
    By LasseA in forum New To Java
    Replies: 3
    Last Post: 11-10-2012, 04:57 PM
  4. Replies: 4
    Last Post: 04-27-2012, 09:43 AM
  5. How complex is too complex for a single class?
    By manji51 in forum AWT / Swing
    Replies: 7
    Last Post: 07-08-2011, 07:20 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
  •