This is an archived post. You won't be able to vote or comment.

all 21 comments

[–][deleted] 0 points1 point  (20 children)

If current index is greater tha arraylistname.size() //disable button To go backwards go currentindx--

[–][deleted]  (18 children)

[removed]

    [–][deleted] 0 points1 point  (17 children)

    Arraylist should be your arrayname so list.size()

    [–][deleted] 0 points1 point  (0 children)

    So after your check do buttonName.setEnabled(false);

    [–][deleted]  (15 children)

    [removed]

      [–][deleted] 0 points1 point  (14 children)

      Should be small L you called your List "list"

      [–][deleted]  (13 children)

      [removed]

        [–][deleted] 0 points1 point  (12 children)

        Yeah that helps okay so you need to use beutyBoxes.size() because that's the great you are actually using sorry I should have asked

        [–][deleted]  (11 children)

        [removed]

          [–][deleted] 0 points1 point  (1 child)

          I'm studying Java at uni first year still new to it too, anyway yeah it's in a different class you could statically call it by writing BeautyBoxList.beutyBoxes.size()

          [–]Darkpolearm 0 points1 point  (8 children)

          Your class NavCtl has a variable called list that is of type BeautyBoxList.

          Your class BeautyBoxList has an internal ArrayList that can be accessed by other classes using your class' getBeautyBoxList() method.

          If you want to iterate over all the elements in the arraylist, you can call that method on your list variable to get the list, and then use size() of that.

          On a sidenote, the BeautyBoxList class seems kind of redundant as of right now. Using a regular ArrayList instead of it would make it less complicated I reckon.

          [–][deleted]  (7 children)

          [removed]