01: /*
02: * WbCheckBox.java
03: *
04: * This file is part of SQL Workbench/J, http://www.sql-workbench.net
05: *
06: * Copyright 2002-2008, Thomas Kellerer
07: * No part of this code maybe reused without the permission of the author
08: *
09: * To contact the author please send an email to: support@sql-workbench.net
10: *
11: */
12: package workbench.gui.components;
13:
14: import javax.swing.JCheckBox;
15:
16: /**
17: *
18: * @author support@sql-workbench.net
19: */
20: public class WbCheckBox extends JCheckBox {
21:
22: public WbCheckBox() {
23: }
24:
25: public WbCheckBox(String text) {
26: super (text);
27: }
28:
29: public void setText(String newText) {
30: int pos = newText.indexOf('&');
31: if (pos > -1) {
32: char mnemonic = newText.charAt(pos + 1);
33: newText = newText.substring(0, pos)
34: + newText.substring(pos + 1);
35: this .setMnemonic((int) mnemonic);
36: }
37: super.setText(newText);
38: }
39:
40: }
|