Skip to content

Commit 56ea1b0

Browse files
committed
frame
1 parent a791920 commit 56ea1b0

File tree

2 files changed

+35
-3
lines changed

2 files changed

+35
-3
lines changed

callc/java/MyFrame.java

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
package mypkg;
2+
3+
import java.awt.*;
4+
import javax.swing.*;
5+
6+
class MyFrame extends JFrame {
7+
JPanel jp;
8+
JButton btn;
9+
JLabel label;
10+
public MyFrame()
11+
{
12+
this.setVisible(true);
13+
this.setSize(250, 220);
14+
this.setVisible(true);
15+
this.setLocation(400, 200);
16+
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
17+
InitPanel(new JPanel());
18+
}
19+
public void InitPanel(JPanel jp)
20+
{
21+
btn = new JButton("btn");
22+
label = new JLabel("label");
23+
jp.add(btn);
24+
jp.add(label);
25+
add(jp);
26+
}
27+
public static void main(String[] args)
28+
{
29+
MyFrame mf = new MyFrame();
30+
return ;
31+
}
32+
}

callc/java/build.bat

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@
33
set JAVA_HOME=D:\Program Files\Java\jdk-12.0.2
44
set PATH=%PATH%;%JAVA_HOME%\bin;
55

6-
set srcs=ForScanner.java ForScannerChild.java TxtParseUtils.java ServerThread.java SocketClient.java SocketServer.java
6+
set srcs=ForScanner.java ForScannerChild.java TxtParseUtils.java ServerThread.java SocketClient.java SocketServer.java MyFrame.java
77

88
for %%i in (%srcs%) do (
99
javac -encoding utf-8 -h . %%i
1010
if not %errorlevel% == 0 (
1111
goto proc_err
1212
) else (
13+
mkdir mypkg
14+
move *.class mypkg
1315
echo %%i succ.................................
1416
)
1517
)
16-
mkdir mypkg
17-
move *.class mypkg
1818

1919
rem java mypkg.SocketServer
2020

0 commit comments

Comments
 (0)