Disable items in JList

前端 未结 4 1318
清歌不尽
清歌不尽 2020-11-29 10:16

I\'m using a JList as part of a wizard to display all the steps to be performed (it also allows clicking on a step to go to it). Some steps will not always be needed, based

4条回答
  •  无人及你
    2020-11-29 10:56

    One solution: You might want to look up AbstractAction in the Java API. Then, implement the COMMAND pattern.

    The idea is to give methods states by making them into classes (which implement AbstractAction). Then, they can disable each other.

    http://en.wikipedia.org/wiki/Command_pattern

    http://docs.oracle.com/javase/6/docs/api/

提交回复
热议问题