to.tetramorph.starbase.formatter
クラス LimitedDocument

java.lang.Object
  上位を拡張 javax.swing.text.AbstractDocument
      上位を拡張 javax.swing.text.PlainDocument
          上位を拡張 to.tetramorph.starbase.formatter.LimitedDocument
すべての実装されたインタフェース:
Serializable, Document

public class LimitedDocument
extends PlainDocument

テキストフィールドの入力文字数に制限をかけるためのもの。

 textfield.setDocument( new LimitedDocument( 10 ) );
 などとして使う。
 

関連項目:
JTextField, 直列化された形式

入れ子のクラスの概要
 
クラス javax.swing.text.AbstractDocument から継承された入れ子のクラス/インタフェース
AbstractDocument.AbstractElement, AbstractDocument.AttributeContext, AbstractDocument.BranchElement, AbstractDocument.Content, AbstractDocument.DefaultDocumentEvent, AbstractDocument.ElementEdit, AbstractDocument.LeafElement
 
フィールドの概要
 
クラス javax.swing.text.PlainDocument から継承されたフィールド
lineLimitAttribute, tabSizeAttribute
 
クラス javax.swing.text.AbstractDocument から継承されたフィールド
BAD_LOCATION, BidiElementName, ContentElementName, ElementNameAttribute, listenerList, ParagraphElementName, SectionElementName
 
インタフェース javax.swing.text.Document から継承されたフィールド
StreamDescriptionProperty, TitleProperty
 
コンストラクタの概要
LimitedDocument(int limit)
          指定された文字数でオブジェクトを作成する。
 
メソッドの概要
 void insertString(int offset, String str, AttributeSet a)
          プログラマがこのメソッドを呼び出す必要は無い。
 
クラス javax.swing.text.PlainDocument から継承されたメソッド
createDefaultRoot, getDefaultRootElement, getParagraphElement, insertUpdate, removeUpdate
 
クラス javax.swing.text.AbstractDocument から継承されたメソッド
addDocumentListener, addUndoableEditListener, createBranchElement, createLeafElement, createPosition, dump, fireChangedUpdate, fireInsertUpdate, fireRemoveUpdate, fireUndoableEditUpdate, getAsynchronousLoadPriority, getAttributeContext, getBidiRootElement, getContent, getCurrentWriter, getDocumentFilter, getDocumentListeners, getDocumentProperties, getEndPosition, getLength, getListeners, getProperty, getRootElements, getStartPosition, getText, getText, getUndoableEditListeners, postRemoveUpdate, putProperty, readLock, readUnlock, remove, removeDocumentListener, removeUndoableEditListener, render, replace, setAsynchronousLoadPriority, setDocumentFilter, setDocumentProperties, writeLock, writeUnlock
 
クラス java.lang.Object から継承されたメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

コンストラクタの詳細

LimitedDocument

public LimitedDocument(int limit)
指定された文字数でオブジェクトを作成する。これをセットされたJTextFieldは、 入力文字数に制限がかかる。

関連項目:
JTextField
メソッドの詳細

insertString

public void insertString(int offset,
                         String str,
                         AttributeSet a)
プログラマがこのメソッドを呼び出す必要は無い。

定義:
インタフェース Document 内の insertString
オーバーライド:
クラス PlainDocument 内の insertString