Swing/WavyLineSeparator のバックアップソース(No.2)
- バックアップ一覧
- 差分 を表示
- 現在との差分 を表示
- 現在との差分 - Visual を表示
- バックアップ を表示
- Swing/WavyLineSeparator へ行く。
- 1 (2006-06-01 (木) 09:28:20)
- 2 (2006-06-19 (月) 06:28:53)
- 3 (2006-06-19 (月) 14:39:12)
- 4 (2006-06-21 (水) 18:42:49)
- 5 (2006-06-22 (木) 18:04:41)
- 6 (2007-01-11 (木) 12:11:35)
- 7 (2007-03-14 (水) 11:31:49)
- 8 (2007-03-28 (水) 18:43:22)
- 9 (2007-10-16 (火) 15:56:39)
- 10 (2009-11-05 (木) 18:24:47)
- 11 (2010-11-15 (月) 14:55:16)
- 12 (2013-02-28 (木) 14:33:31)
- 13 (2014-11-18 (火) 16:09:46)
- 14 (2014-12-01 (月) 17:26:21)
- 15 (2016-01-29 (金) 14:02:05)
- 16 (2017-06-30 (金) 13:52:10)
- 17 (2018-06-01 (金) 14:42:37)
- 18 (2020-05-30 (土) 01:08:58)
- 19 (2021-11-12 (金) 13:56:05)
TITLE:Separatorを波線で表示 #navi(../) *Separatorを波線で表示 [#g6af9d8e] >編集者:[[Terai Atsuhiro>terai]]~ 作成日:& date;~ 更新日:&lastmod; #contents **概要 [#jc12c5ca] 波線を使ったSeparatorを作成します。 #screenshot **サンプルコード [#r8936d7c] class WavyLineSeparator extends JComponent{ public WavyLineSeparator() { super(); setPreferredSize(new Dimension(100, 3)); setMinimumSize(new Dimension(0, 3)); setMaximumSize(new Dimension(Integer.MAX_VALUE, 3)); setBorder(new MatteBorder(0,0,3,0,new WavyLineIcon()));; } class WavyLineIcon implements Icon { public void paintIcon(Component c, Graphics g, int x, int y) { Graphics2D g2 = (Graphics2D)g; g2.setColor(SystemColor.textText); g2.translate(x,y); g2.drawLine( 0, 2, 0, 2 ); g2.drawLine( 1, 1, 1, 1 ); g2.drawLine( 2, 0, 3, 0 ); g2.drawLine( 4, 1, 4, 1 ); g2.drawLine( 5, 2, 5, 2 ); g2.translate(-x,-y); } public int getIconWidth() { return 6; } public int getIconHeight() { return 3; } } } } -&jnlp; -&jar; -&zip; **解説 [#q8db10c5] 波上のIconを作成して、これをMatteBorderを使って並べています。 上記のサンプルでは水平方向限定のセパレーターになります。 //**参考リンク **コメント [#l8c965e9] #comment