1
4

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 3 years have passed since last update.

SWING入門

Last updated at Posted at 2021-01-02

###メソッドの種類


####drawLine(x1, y1, x2, y2)
点 (x1, y1) から点 (x2, y2) へ直線を描く.


####drawString("文字列", x, y)
点 (x, y) を左下とする位置に文字列を配置する.


####drawRect(x, y, w, h)
点 (x, y) を左上とし,横幅 w,高さ h の長方形を描く.


####fillRect(x, y, w, h)
点 (x, y) を左上とし,横幅 w,高さ h の長方形を描き,内部を塗りつぶす.


####drawOval(x, y, w, h)
点 (x, y) を左上とし,横幅 w,高さ h の長方形に内接する楕円を描く.


####fillOval(x, y, w, h)
点 (x, y) を左上とし,横幅 w,高さ h の長方形に内接する楕円を描き,内部を塗りつぶす.


####drawPolygon(x, y, n)
x 座標の配列 x と y 座標の配列 y で定義した n 点で構成する多角形を描く.


####fillPolygon(x, y, n)
x 座標の配列 x と y 座標の配列 y で定義した n 点で構成する多角形を描き,内部を塗りつぶす.


####drawPolyline(x, y, n)
x 座標の配列 x と y 座標の配列 y で定義した n 点を連続的につながった直線で描く.


####drawRoundRect(x,y,w,h,aw,ah)
丸いコーナー付きの輪郭の長方形を描く.


####fillRoundRect(x,y,w,h,aw,ah)
丸いコーナー付きの輪郭の長方形を描き,内部を塗りつぶす.


###Classの種類


####JFrame
端末の画面上にフレーム(ウィンドウ)の表示させるclass


####JPanel
フレーム内に図形などのGUI部品を配置するclass


####Container
GUI部品を保持するためのコンテナclass


####Graphics
フレーム内に描画するclass


####Color
色を扱うclass


###ウィンドウ上の座標
1キャプチャ.PNG

1
4
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
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?