FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
JavaGraph/GirdLayout_t.java at master · goder/JavaGraph · GitHub
goder
JavaGraph
Repository navigation
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
JavaGraph
/
GirdLayout_t.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
37 lines (32 loc) · 759 Bytes
Breadcrumbs
JavaGraph
/
GirdLayout_t.java
Copy path
File metadata and controls
37 lines (32 loc) · 759 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package
com
.
bj
;
import
javax
.
swing
.*;
import
java
.
awt
.*;
public
class
GirdLayout_t
extends
JFrame
{
//定义组件
JButton
jbs
[]=
new
JButton
[
9
];
int
size
=
9
;
public
static
void
main
(
String
[]
args
) {
// TODO Auto-generated method stub
GirdLayout_t
g
=
new
GirdLayout_t
();
}
//构造方法
public
GirdLayout_t
(){
//创建组件
for
(
int
i
=
0
;
i
<
9
;
i
++){
jbs
[
i
]=
new
JButton
(
String
.
valueOf
(
i
));
}
//设置网格布局3行3列,行间距10,列间距15
this
.
setLayout
(
new
GridLayout
(
3
,
3
,
10
,
15
));
//添置组件
for
(
int
i
=
0
;
i
<
size
;
i
++){
this
.
add
(
jbs
[
i
]);
}
//设置窗体属性
this
.
setTitle
(
"GirdLayout "
);
this
.
setSize
(
300
,
200
);
this
.
setDefaultCloseOperation
(
JFrame
.
EXIT_ON_CLOSE
);
this
.
setLocation
(
200
,
200
);
//设置可视
this
.
setVisible
(
true
);
}
}
Back
|
FazBrowse Home
|
New Git URL