Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #26 from joaquinmag/patch-1

Fixed bug Exception launched when it had no fields
  • Loading branch information...
commit 3adf263f0bf22066e9b37d34a9023b74610535ec 2 parents e2a6c85 + 167f17a
@pelegri pelegri authored
View
8 Advanced UI/src/com/samples/toolkit/ui/container/JustifiedEvenlySpacedHorizontalFieldManager.java
@@ -46,7 +46,13 @@ protected void sublayout( int width, int height )
// There may be a few remaining pixels after dividing up the space
// we must split up the space between the first and last buttons
- int fieldWidth = width / numFields;
+
+ //if there are no fields the current fieldWidth should be 0
+ final int fieldWidth;
+ if (numFields == 0)
+ fieldWidth = 0;
+ else
+ fieldWidth = width / numFields;
int firstFieldExtra = 0;
int lastFieldExtra = 0;
Please sign in to comment.
Something went wrong with that request. Please try again.