1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

AsWingのJScrollPaneの中身を左上にそろえる。

Last updated at Posted at 2012-05-25

ハイクオリティGUIライブラリAsWing( http://www.aswing.org )のTips4つ目。

JScrollPaneでJPanelなどにスクロールバーを表示させる時、
中身がJScrollPaneより小さいと自動的に中央揃えになる。

これを左上にしたいときは以下のように書く。

ScrollPaneTest.as
var scroll:JScrollPane = new JScrollPane( new JPanel() );
var viewPort:JViewport = scroll.getViewport() as JViewport;
viewPort.setVerticalAlignment( JViewport.TOP );
viewPort.setHorizontalAlignment( JViewport.LEFT );	
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?