質問編集履歴

2

ソース追加

2018/09/19 13:58

投稿

yukkuri
yukkuri

スコア624

test CHANGED
File without changes
test CHANGED
@@ -269,3 +269,35 @@
269
269
 
270
270
 
271
271
  ちなみにEclipse, java7 で、エラーは一瞬しか表示されませんでした。実行はされます。
272
+
273
+
274
+
275
+ 追加 呼び出しクラス
276
+
277
+ ```java
278
+
279
+ final class SwingTest
280
+
281
+ {
282
+
283
+ public static void main( String[] args ) throws InterruptedException
284
+
285
+ {
286
+
287
+ JylFrame jf = new JylFrame();
288
+
289
+ jf.setSize( new ComSize( 640, 480 ) );
290
+
291
+ jf.add( new SwingTestPanel() );
292
+
293
+ jf.setVisible( true );
294
+
295
+ Thread.sleep( 10000 );
296
+
297
+ System.exit( 0 );
298
+
299
+ }
300
+
301
+ }
302
+
303
+ ```

1

code追加 不要部分削除

2018/09/19 13:58

投稿

yukkuri
yukkuri

スコア624

test CHANGED
File without changes
test CHANGED
@@ -20,16 +20,6 @@
20
20
 
21
21
 
22
22
 
23
- /**
24
-
25
- * 簡易的なフレームのクラスです。
26
-
27
- *
28
-
29
- * @author とあるゆっくり
30
-
31
- */
32
-
33
23
  public class JylFrame extends JFrame
34
24
 
35
25
  {
@@ -46,12 +36,6 @@
46
36
 
47
37
 
48
38
 
49
- /**
50
-
51
- * 不可視のフレームを作成します。
52
-
53
- */
54
-
55
39
  public JylFrame()
56
40
 
57
41
  {
@@ -64,20 +48,6 @@
64
48
 
65
49
 
66
50
 
67
- /**
68
-
69
- * 不可視のフレームを作成します。このコンストラクタでは、
70
-
71
- * フレームをフルスクリーン化できますが、終了時にフレームを戻す必要があります。
72
-
73
- * フルスクリーン化しない場合は、終了処理を含めてすべてユーザーが設定する必要があります。
74
-
75
- *
76
-
77
- * @param fullscreen フルスクリーン化する場合は true
78
-
79
- */
80
-
81
51
  public JylFrame( boolean fullscreen )
82
52
 
83
53
  {
@@ -90,16 +60,6 @@
90
60
 
91
61
 
92
62
 
93
- /**
94
-
95
- * フレームの背景色を設定します。
96
-
97
- *
98
-
99
- * @param argb 背景色のARGB値
100
-
101
- */
102
-
103
63
  public void setBackground( int argb )
104
64
 
105
65
  {
@@ -112,16 +72,6 @@
112
72
 
113
73
 
114
74
 
115
- /**
116
-
117
- * フレームの位置、サイズを設定します。
118
-
119
- *
120
-
121
- * @param f フレームの座標、サイズを代入された ComSize
122
-
123
- */
124
-
125
75
  public void setBounds( ComSize f )
126
76
 
127
77
  {
@@ -138,16 +88,6 @@
138
88
 
139
89
 
140
90
 
141
- /**
142
-
143
- * フレームの位置を設定します。
144
-
145
- *
146
-
147
- * @param f フレームの位置を代入された ComSize
148
-
149
- */
150
-
151
91
  public void setLocation( ComSize f )
152
92
 
153
93
  {
@@ -160,16 +100,6 @@
160
100
 
161
101
 
162
102
 
163
- /**
164
-
165
- * フレームのサイズを設定します。
166
-
167
- *
168
-
169
- * @param f フレームのサイズを代入された ComSize
170
-
171
- */
172
-
173
103
  public void setSize( ComSize f )
174
104
 
175
105
  {
@@ -230,6 +160,88 @@
230
160
 
231
161
 
232
162
 
163
+ ComSize.java
164
+
165
+ ```java
166
+
167
+ package org.yukkuri.jyl.base;
168
+
169
+
170
+
171
+ public class ComSize
172
+
173
+ {
174
+
175
+
176
+
177
+ public int x;
178
+
179
+
180
+
181
+ public int y;
182
+
183
+
184
+
185
+ public int width;
186
+
187
+
188
+
189
+ public int height;
190
+
191
+
192
+
193
+ public ComSize()
194
+
195
+ {
196
+
197
+ x = y = width = height = 0;
198
+
199
+ }
200
+
201
+
202
+
203
+ public ComSize( int x, int y )
204
+
205
+ {
206
+
207
+ this.x = x; this.y = y;
208
+
209
+ this.width = this.height = 0;
210
+
211
+ }
212
+
213
+
214
+
215
+ public ComSize( int xy, int width, int height )
216
+
217
+ {
218
+
219
+ this.x = xy; this.y = xy;
220
+
221
+ this.width = width; this.height = height;
222
+
223
+ }
224
+
225
+
226
+
227
+ public ComSize( int x, int y, int width, int height )
228
+
229
+ {
230
+
231
+ this.x = x; this.y = y;
232
+
233
+ this.width = width; this.height = height;
234
+
235
+ }
236
+
237
+ }
238
+
239
+
240
+
241
+ ```
242
+
243
+
244
+
233
245
  この中のsetSize( ComSize )を呼び出すと、
234
246
 
235
247
  ```エラー