/
TextContainer.java
executable file
·35 lines (32 loc) · 1.18 KB
/
TextContainer.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/*
* __ __ ____ _____ _ _ _
* \ \ / /___ / ___| | ___| | | |_| _| |_
* \ \ / // _ \/ / __ | |_ __| | _ |_ _|
* \ \/ /| ___ | |_ \| _| / _ | | | | |
* \ / | |____ \___| |___ | |_| | | | | |_
* \/ \____/\_____/|_____| \____| |_| |___|
*
*
* Copyright (c) 2011 onwards by WeaveBytes, Inc.
* Please reports bugs at weavebytes@gmail.com
*
* This file may be distributed and/or modified under the terms of the
* GNU General Public License version 2 as published by the Free Software
* Foundation. (See COPYING.GPL for details.)
*
* This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
* WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
*/
import javax.swing.JTextField;
public class TextContainer {
private static TextContainer _instance = new TextContainer();
private JTextField tf;
private TextContainer() {
tf= new JTextField(30);
}
//return singleton
public static TextContainer getInstance() { return _instance; }
public JTextField getTextField() { return tf; }
public String getText() { return tf.getText(); }
}