First commit, added all projects
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
package gui;
|
||||
|
||||
import javax.swing.JTextField;
|
||||
import javax.swing.text.Document;
|
||||
|
||||
|
||||
/**
|
||||
* An text field with the ability to set a list of words to attempt to auto-complete from.
|
||||
*/
|
||||
public class CompletingField extends JTextField
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
private CompletingDocument document;
|
||||
|
||||
@Override
|
||||
protected Document createDefaultModel()
|
||||
{
|
||||
document = new CompletingDocument(this);
|
||||
return document;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param fileName The name of a file to read a list of auto-complete candidates from
|
||||
*/
|
||||
public void setWordList(final String fileName)
|
||||
{
|
||||
document.setWordList(fileName);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user