-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
68 changed files
with
1,534 additions
and
0 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<module type="JAVA_MODULE" version="4"> | ||
<component name="NewModuleRootManager" inherit-compiler-output="true"> | ||
<exclude-output /> | ||
<content url="file://$MODULE_DIR$"> | ||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" /> | ||
</content> | ||
<orderEntry type="inheritedJdk" /> | ||
<orderEntry type="sourceFolder" forTests="false" /> | ||
</component> | ||
</module> |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import javax.swing.*; | ||
import java.awt.*; | ||
public class BorderLayoutEx extends JFrame { | ||
public BorderLayoutEx() { | ||
setTitle("BorderLayout Sample"); | ||
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); | ||
Container c = getContentPane(); | ||
c.setLayout(new BorderLayout(30, 20)); | ||
c.add(new JButton("Calculate"), BorderLayout.CENTER); | ||
c.add(new JButton("add"), BorderLayout.NORTH); | ||
c.add(new JButton("sub"), BorderLayout.SOUTH); | ||
c.add(new JButton("mul"), BorderLayout.EAST); | ||
c.add(new JButton("div"), BorderLayout.WEST); | ||
setSize(300, 200); // 프레임 크기 300×200 설정 | ||
setVisible(true); // 프레임을 화면에 출력 | ||
} | ||
public static void main(String[] args) { | ||
new BorderLayoutEx(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import javax.swing.*; | ||
import java.awt.*; | ||
public class ContentPaneEx extends JFrame { | ||
public ContentPaneEx() { | ||
setTitle("ContentPane과 JFrame"); | ||
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); | ||
Container contentPane = getContentPane(); | ||
contentPane.setBackground(Color.ORANGE); | ||
contentPane.setLayout(new FlowLayout()); | ||
contentPane.add(new JButton("OK")); | ||
contentPane.add(new JButton("Cancel")); | ||
contentPane.add(new JButton("Ignore")); | ||
setSize(300, 150); | ||
setVisible(true); | ||
} | ||
public static void main(String[] args) { | ||
new ContentPaneEx(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import javax.swing.*; | ||
import java.awt.*; | ||
public class FlowLayoutEx extends JFrame { | ||
public FlowLayoutEx() { | ||
setTitle("FlowLayout Sample"); | ||
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); | ||
Container c = getContentPane(); | ||
c.setLayout(new FlowLayout(FlowLayout.LEFT, 30, 40)); | ||
c.add(new JButton("add")); | ||
c.add(new JButton("sub")); | ||
c.add(new JButton("mul")); | ||
c.add(new JButton("div")); | ||
c.add(new JButton("Calculate")); | ||
setSize(300, 200); | ||
setVisible(true); | ||
} | ||
public static void main(String[] args) { | ||
new FlowLayoutEx(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import javax.swing.*; | ||
import java.awt.*; | ||
public class GridLayoutEx extends JFrame { | ||
public GridLayoutEx() { | ||
setTitle("GridLayout Sample"); | ||
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); | ||
GridLayout grid = new GridLayout(4, 2); | ||
grid.setVgap(5); | ||
Container c = getContentPane(); | ||
c.setLayout(grid); | ||
c.add(new JLabel(" 이름")); | ||
c.add(new JTextField("")); | ||
c.add(new JLabel(" 학번")); | ||
c.add(new JTextField("")); | ||
c.add(new JLabel(" 학과")); | ||
c.add(new JTextField("")); | ||
c.add(new JLabel(" 과목")); | ||
c.add(new JTextField("")); | ||
setSize(300, 200); | ||
setVisible(true); | ||
} | ||
public static void main(String[] args) { | ||
new GridLayoutEx(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import java.awt.BorderLayout; | ||
import java.awt.Container; | ||
import javax.swing.JButton; | ||
import javax.swing.JFrame; | ||
|
||
public class Lab08Ex01 extends JFrame { | ||
Lab08Ex01() { | ||
setTitle("BorderLayout Practice"); | ||
setSize(400, 200); | ||
setDefaultCloseOperation(EXIT_ON_CLOSE); | ||
|
||
Container c=getContentPane(); | ||
c.setLayout(new BorderLayout(5,7)); | ||
|
||
c.add(new JButton("North"), BorderLayout.NORTH); //대문자 | ||
c.add(new JButton("West"), BorderLayout.WEST); | ||
c.add(new JButton("Center"), BorderLayout.CENTER); | ||
c.add(new JButton("East"), BorderLayout.EAST); | ||
c.add(new JButton("South"), BorderLayout.SOUTH); | ||
setVisible(true); | ||
} | ||
|
||
public static void main(String[] args) { | ||
new Lab08Ex01(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import javax.swing.*; | ||
import java.awt.*; | ||
|
||
public class Lab08Ex02 extends JFrame { | ||
Lab08Ex02() { | ||
setTitle("BorderLayout Practice"); | ||
setSize(400, 200); | ||
setDefaultCloseOperation(EXIT_ON_CLOSE); | ||
|
||
Container c=getContentPane(); | ||
c.setLayout(new BorderLayout(5,7)); | ||
|
||
c.add(new JButton("North"), BorderLayout.NORTH); | ||
c.add(new JButton("West"), BorderLayout.WEST); | ||
c.add(new JButton("Center"), BorderLayout.CENTER); | ||
c.add(new JButton("East"), BorderLayout.EAST); | ||
c.add(new JButton("South"), BorderLayout.SOUTH); | ||
setVisible(true); | ||
} | ||
|
||
public static void main(String[] args) { | ||
new Lab08Ex02(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import javax.swing.*; | ||
import java.awt.*; | ||
|
||
public class Lab08Ex03 extends JFrame { | ||
Lab08Ex03() { | ||
setTitle("BorderLayout Practice"); | ||
setSize(600, 300); | ||
setDefaultCloseOperation(EXIT_ON_CLOSE); | ||
|
||
Container c=getContentPane(); | ||
c.setLayout(new GridLayout(1,10)); | ||
|
||
for(int i=0; i<10; i++) { | ||
c.add(new JButton(i + "")); | ||
} | ||
setVisible(true); | ||
} | ||
|
||
public static void main(String[] args) { | ||
new Lab08Ex03(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import java.awt.*; | ||
import javax.swing.*; | ||
|
||
public class Lab08Ex04 extends JFrame { | ||
Lab08Ex04() { | ||
setTitle("Ten Color Buttons Frame"); | ||
setSize(600, 300); | ||
setDefaultCloseOperation(EXIT_ON_CLOSE); | ||
|
||
Container c=getContentPane(); | ||
c.setLayout(new GridLayout(1,10)); | ||
|
||
for(int i=0; i<10; i++) { | ||
Color[] col= {Color.RED, Color.ORANGE, Color.YELLOW, Color.GREEN, | ||
Color.CYAN, Color.BLUE, Color.MAGENTA, | ||
Color.GRAY, Color.PINK, Color.LIGHT_GRAY}; | ||
String text=Integer.toString(i); | ||
JButton b=new JButton(text); | ||
b.setOpaque(true); | ||
b.setBackground(col[i]); | ||
c.add(b); | ||
} | ||
setVisible(true); | ||
} | ||
public static void main(String[] args) { | ||
new Lab08Ex04(); | ||
} | ||
} |
Oops, something went wrong.