Java tutorial
//package com.java2s; import javax.swing.JCheckBox; import javax.swing.JComponent; public class Main { public static JCheckBox createCheckBox() { final JCheckBox c = new JCheckBox(); configureActiveComponent(c); return c; } private static JComponent configureActiveComponent(JComponent c) { // if (benchRuns == 0) { // c.addMouseMotionListener(toolTipListener); // c.addMouseListener(constraintListener); // } return c; } }