public DialogOptionComponent(DialogOptionListener parent, GameOption option, boolean editable) { this.parent = parent; this.option = option;  addMouseListener(this);  setLayout(new BorderLayout()); switch(option.getType()) { case GameOption.BOOLEAN : checkbox = new Checkbox(option.getFullName(), option.booleanValue()); checkbox.addMouseListener(this); checkbox.addItemListener(this); add(checkbox, BorderLayout.CENTER);  if ( !editable ) checkbox.setEnabled(false);  break; case GameOption.CHOICE : choice = new Choice();  choice.addMouseListener(this); label = new Label(option.getFullName()); label.addMouseListener(this); add(label, BorderLayout.WEST); add(choice, BorderLayout.CENTER);  if ( !editable ) choice.setEnabled(false);  break; default : textField = new TextField(option.stringValue(), option.getTextFieldLength()); textField.addMouseListener(this); label = new Label(option.getFullName()); label.addMouseListener(this);  if ( option.isLabelBeforeTextField() ) { add(label, BorderLayout.CENTER); add(textField, BorderLayout.WEST); } else { add(textField, BorderLayout.WEST); add(label, BorderLayout.CENTER); }  if ( !editable ) textField.setEnabled(false);  break; }
public DialogOptionComponent(DialogOptionListener parent, GameOption option) { this(parent, option, true);
    public DialogOptionComponent(DialogOptionListener parent, GameOption option, boolean editable) {        this.parent = parent;        this.option = option;                addMouseListener(this);                setLayout(new BorderLayout());        switch(option.getType()) {            case GameOption.BOOLEAN :                checkbox = new Checkbox(option.getFullName(), option.booleanValue());                checkbox.addMouseListener(this);                checkbox.addItemListener(this);                add(checkbox, BorderLayout.CENTER);                                if ( !editable )                  checkbox.setEnabled(false);                                  break;            case GameOption.CHOICE :                choice = new Choice();                choice.addMouseListener(this);                label = new Label(option.getFullName());                label.addMouseListener(this);                add(label, BorderLayout.WEST);                add(choice, BorderLayout.CENTER);                                if ( !editable )                  choice.setEnabled(false);                break;            default :                textField = new TextField(option.stringValue(), option.getTextFieldLength());                textField.addMouseListener(this);                label = new Label(option.getFullName());                label.addMouseListener(this);                if ( option.isLabelBeforeTextField() ) {                  add(label, BorderLayout.CENTER);                  add(textField, BorderLayout.WEST);                } else {                  add(textField, BorderLayout.WEST);                  add(label, BorderLayout.CENTER);                }                if ( !editable )                  textField.setEnabled(false);                break;        }            }