• 追加された行はこの色です。
  • 削除された行はこの色です。
TITLE:JButtonのテキストシフト量を変更
#navi(../)
#tags()
RIGHT:Posted by &author(aterai); at 2007-12-31
*JButtonのテキストシフト量を変更 [#q33481d1]
JButtonをクリックしたときのテキストシフト量を変更します。
---
title: JButtonのテキストシフト量を変更
tags: [JButton, UIManager]
author: aterai
pubdate: 2007-12-31T16:51:19+09:00
description: JButtonをクリックしたときのテキストシフト量を変更します。
---
* 概要 [#q33481d1]
`JButton`をクリックしたときのテキストシフト量を変更します。

-&jnlp;
-&jar;
-&zip;
#download(https://lh6.googleusercontent.com/_9Z4BYR88imo/TQTVR92SsdI/AAAAAAAAAnY/_wKFJTNu2oY/s800/TextShiftOffset.png)

//#screenshot
#ref(http://lh6.ggpht.com/_9Z4BYR88imo/TQTVR92SsdI/AAAAAAAAAnY/_wKFJTNu2oY/s800/TextShiftOffset.png)

**サンプルコード [#fd17120e]
* サンプルコード [#fd17120e]
#code(link){{
UIManager.put("Button.textShiftOffset", 0);
SwingUtilities.updateComponentTreeUI(this);
}}

**解説 [#m09c32c8]
上記のサンプルでは、テキストシフト量を、0、1、-1と切り替えることができます。
* 解説 [#m09c32c8]
上記のサンプルでは、テキストシフト量を、`0`、`1`、`-1`と切り替えることができます。

-メモ
--Java 1.5.0 + Windows L&F のデフォルトは 1
--Java 1.6.0 + Windows L&F のデフォルトは 0
- メモ
-- `Java 1.5.0` + `WindowsLookAndFeel`のデフォルトは`1`
-- `Java 1.6.0` + `WindowsLookAndFeel`のデフォルトは`0`

//**参考リンク
**コメント [#i782599b]
//* 参考リンク
* コメント [#i782599b]
#comment
#comment