Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I assume you have a Button or something to have the user confirming its selection. This selection should then trigger an ActionListeners actionPerformed Method in which you must ensure to have access to the different UI elements. </p> <p>Inside the action Performed Method i would not bother about the specific selections if not absolutly necessary, instead i would just do two things (this assumes a very simple case):</p> <p>For any selected checkbox (Direction 1-4)....</p> <p>1.) ...get the according start values, determine the lowest value 2.) ...get the according end values, determine the hightest value 3.) Exclude all values between the lowest and highest value </p> <p>This way you dont have to care about the different values that can overlap. However if you want to be able to exclude segments and still dont have to bother about overlapping you would have to do something like this:</p> <p>For any selected checkbox (Direction 1-4)....</p> <p>1.) ... get the according start/end values 2.) ... call a method to add numbers to be excluded to a array delivering the start/ end values 3.) ... have the method look at the current array of numbers to check if the start/ end values or the values between them is already included, if not have this method adding the values 4.) ... Use the prepared array from that method </p> <p>This would be more likely the case if for example you want to exclude range 100-200 and 400-500 but still have 201-399 included. </p> <p>Feel free to provide your code so we will understand much better in what form you need that exclusion (like just numbers in an array, a min/max value or a own datatype Range or something). </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload