Class HistoryComboBox

All Implemented Interfaces:
ActionListener, ImageObserver, ItemSelectable, MenuContainer, Serializable, EventListener, Accessible, ListDataListener

public class HistoryComboBox extends JComboBox<String>
履歴保持機能付きComboBox addHistoryメソッドでドロップダウンリストに文字列を追加できます。
See Also:
  • Constructor Details

    • HistoryComboBox

      public HistoryComboBox()
  • Method Details

    • getHistoryCount

      public int getHistoryCount()
      履歴を保持する件数を取得
    • setHistoryCount

      public void setHistoryCount(int n)
      履歴を保持する件数を設定
    • addHistory

      public void addHistory(String s)
      リストの先頭に引数の文字列を追加
      引数の文字列がリストに含まれる場合は先頭に移動
    • updateHistory

      public void updateHistory()
      現在選択中の文字列をaddHistory
    • saveToFile

      public void saveToFile(File f) throws IOException
      リストをファイルに保存
      Throws:
      IOException
    • loadFromFile

      public void loadFromFile(File f) throws IOException
      リストをファイルから読込み
      Throws:
      IOException