How do I stop the cardlayout .next() and .previous() from looping

后端 未结 2 1232
轮回少年
轮回少年 2021-01-24 21:31

I have here a sample of a program here. I have 3 panels and I want to stop the user in pressing the previous button if the panel is in panel_1 and also stop at the

2条回答
  •  礼貌的吻别
    2021-01-24 22:14

    Check out Card Layout Actions for a simple extension of the CardLayout.

    It provides "Next" and "Previous" actions that you can use to create buttons or menu items and the Actions will automatically be disabled when you are at the end/beginning of the cards.

提交回复
热议问题