#navi(../)
*JComboBoxのItemを左右にクリップして配置 [#td747fe0]
>編集者:[[Terai Atsuhiro>terai]]~
作成日:2005-09-12~
更新日:&lastmod;

#contents

**概要 [#p068c669]
JComboBoxのItemにテキストをクリップして左右に分けて配置します。

http://terai.xrea.jp/swing/clippedlrcomboBox/screenshot.png

**サンプルコード [#n26d00a1]


-[[サンプルを起動>http://terai.xrea.jp/swing/clippedlrcomboBox/sample.jnlp]]
-[[jarファイル>http://terai.xrea.jp/swing/clippedlrcomboBox/sample.jar]]
-[[ソース>http://terai.xrea.jp/swing/clippedlrcomboBox/src.zip]]

**解説 [#y1b479cc]
上記のサンプルは、[[JComboBoxのItemを左右に配置>Swing/LRComboBox]]と同じように、Itemに設定した文字列を左右に表示しますが、htmlのtableタグは使用せず、JLabelを二つ並べたJPanelを使用しています。このため文字列が長い場合、JLabelがこれを自動的にクリップして表示します。

**参考リンク [#w60ad6dd]
-[[JComboBoxのItemを左右に配置>Swing/LRComboBox]]

**コメント [#n7dbe41e]
#comment