Here you can find the source of configureJCheckBoxMenuItem( final JCheckBoxMenuItem mi, final Action a)
public static void configureJCheckBoxMenuItem( final JCheckBoxMenuItem mi, final Action a)
//package com.java2s; /*//from ww w .j a v a2 s . c o m * @(#)ActionUtil.java * * Copyright (c) 1996-2010 by the original authors of JHotDraw and all its * contributors. All rights reserved. * * You may not use, copy or modify this file, except in compliance with the * license agreement you entered into with the copyright holders. For details * see accompanying license terms. */ import javax.swing.*; public class Main { /** * Configures a JCheckBoxMenuItem for an Action. */ public static void configureJCheckBoxMenuItem( final JCheckBoxMenuItem mi, final Action a) { /*mi.setSelected((Boolean) a.getValue(ActionUtil.SELECTED_KEY)); PropertyChangeListener propertyHandler = new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent evt) { if (evt.getPropertyName().equals(ActionUtil.SELECTED_KEY)) { mi.setSelected((Boolean) a.getValue(ActionUtil.SELECTED_KEY)); } } }; a.addPropertyChangeListener(propertyHandler); mi.putClientProperty("actionPropertyHandler", propertyHandler); */ mi.setAction(a); } }