Restore
This commit is contained in:
10
Labs/Lab10/Lab10_2230026071/Question7/.classpath
Normal file
10
Labs/Lab10/Lab10_2230026071/Question7/.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/Question7/.project
Normal file
17
Labs/Lab10/Lab10_2230026071/Question7/.project
Normal file
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>Question7</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/Question7/bin/MyFrame.class
Normal file
BIN
Labs/Lab10/Lab10_2230026071/Question7/bin/MyFrame.class
Normal file
Binary file not shown.
BIN
Labs/Lab10/Lab10_2230026071/Question7/bin/MyPanel.class
Normal file
BIN
Labs/Lab10/Lab10_2230026071/Question7/bin/MyPanel.class
Normal file
Binary file not shown.
BIN
Labs/Lab10/Lab10_2230026071/Question7/bin/Start$1.class
Normal file
BIN
Labs/Lab10/Lab10_2230026071/Question7/bin/Start$1.class
Normal file
Binary file not shown.
BIN
Labs/Lab10/Lab10_2230026071/Question7/bin/Start.class
Normal file
BIN
Labs/Lab10/Lab10_2230026071/Question7/bin/Start.class
Normal file
Binary file not shown.
28
Labs/Lab10/Lab10_2230026071/Question7/src/MyFrame.java
Normal file
28
Labs/Lab10/Lab10_2230026071/Question7/src/MyFrame.java
Normal file
@@ -0,0 +1,28 @@
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Color;
|
||||
import java.awt.FlowLayout;
|
||||
import java.awt.GridLayout;
|
||||
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JCheckBox;
|
||||
import javax.swing.JComboBox;
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.JRadioButton;
|
||||
import javax.swing.JTextField;
|
||||
|
||||
public class MyFrame extends JFrame{
|
||||
//constructor
|
||||
public MyFrame() {
|
||||
this.setTitle("MyFrame Title");
|
||||
this.setSize(400, 300);
|
||||
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
this.setLocationRelativeTo(null);
|
||||
|
||||
this.add(new MyPanel());
|
||||
|
||||
this.setVisible(true);
|
||||
}
|
||||
|
||||
}
|
||||
29
Labs/Lab10/Lab10_2230026071/Question7/src/MyPanel.java
Normal file
29
Labs/Lab10/Lab10_2230026071/Question7/src/MyPanel.java
Normal file
@@ -0,0 +1,29 @@
|
||||
import java.awt.Color;
|
||||
import java.awt.Graphics;
|
||||
|
||||
import javax.swing.JPanel;
|
||||
|
||||
public class MyPanel extends JPanel{
|
||||
@Override
|
||||
protected void paintComponent(Graphics g) {
|
||||
super.paintComponent(g);
|
||||
//cubic
|
||||
g.setColor(Color.RED);
|
||||
//front & back of the cubic
|
||||
g.drawRect(30,10,60,60);
|
||||
g.drawRect(10,20,60,60);
|
||||
//4 lines connecting two squares
|
||||
g.drawLine(30, 10, 10, 20);
|
||||
g.drawLine(90, 70, 70, 80);
|
||||
g.drawLine(90, 10, 70, 20);
|
||||
g.drawLine(30, 70, 10, 80);
|
||||
//cylinder
|
||||
g.setColor(Color.BLUE);
|
||||
//top & bottom of the cylinder
|
||||
g.drawOval(120, 10, 60, 15);
|
||||
g.drawOval(120, 70, 60, 15);
|
||||
//2 lines connecting two ovals
|
||||
g.drawLine(120, 17, 120, 77);
|
||||
g.drawLine(180, 17, 180, 77);
|
||||
}
|
||||
}
|
||||
13
Labs/Lab10/Lab10_2230026071/Question7/src/Start.java
Normal file
13
Labs/Lab10/Lab10_2230026071/Question7/src/Start.java
Normal file
@@ -0,0 +1,13 @@
|
||||
|
||||
public class Start {
|
||||
|
||||
public static void main(String[] args) {
|
||||
javax.swing.SwingUtilities.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
new MyFrame();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user