Restore
This commit is contained in:
10
Labs/Lab10/Lab10_2230026071/Question1/.classpath
Normal file
10
Labs/Lab10/Lab10_2230026071/Question1/.classpath
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
|
||||
<attributes>
|
||||
<attribute name="module" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
||||
17
Labs/Lab10/Lab10_2230026071/Question1/.project
Normal file
17
Labs/Lab10/Lab10_2230026071/Question1/.project
Normal file
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>Question1</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
@@ -0,0 +1,2 @@
|
||||
eclipse.preferences.version=1
|
||||
encoding/<project>=UTF-8
|
||||
BIN
Labs/Lab10/Lab10_2230026071/Question1/bin/MyFrame.class
Normal file
BIN
Labs/Lab10/Lab10_2230026071/Question1/bin/MyFrame.class
Normal file
Binary file not shown.
BIN
Labs/Lab10/Lab10_2230026071/Question1/bin/Start$1.class
Normal file
BIN
Labs/Lab10/Lab10_2230026071/Question1/bin/Start$1.class
Normal file
Binary file not shown.
BIN
Labs/Lab10/Lab10_2230026071/Question1/bin/Start.class
Normal file
BIN
Labs/Lab10/Lab10_2230026071/Question1/bin/Start.class
Normal file
Binary file not shown.
13
Labs/Lab10/Lab10_2230026071/Question1/src/MyFrame.java
Normal file
13
Labs/Lab10/Lab10_2230026071/Question1/src/MyFrame.java
Normal file
@@ -0,0 +1,13 @@
|
||||
import javax.swing.JFrame;
|
||||
|
||||
public class MyFrame extends JFrame{
|
||||
//constructor
|
||||
public MyFrame() {
|
||||
this.setTitle("MyFrame Title"); //if comment out, the title would be blank
|
||||
this.setSize(400, 300); //if comment out, the initiated size would be 0
|
||||
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //if comment out, the program would still running after clicked close button
|
||||
this.setLocationRelativeTo(null); //if comment out, the frame would appear at (0, 0)
|
||||
this.setVisible(true); //if comment out, the window would not be visible
|
||||
}
|
||||
|
||||
}
|
||||
14
Labs/Lab10/Lab10_2230026071/Question1/src/Start.java
Normal file
14
Labs/Lab10/Lab10_2230026071/Question1/src/Start.java
Normal file
@@ -0,0 +1,14 @@
|
||||
|
||||
public class Start {
|
||||
|
||||
public static void main(String[] args) {
|
||||
javax.swing.SwingUtilities.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
new MyFrame();
|
||||
//new MyFrame(); two same window appeared
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user