Skip to content

Commit

Permalink
20221101
Browse files Browse the repository at this point in the history
  • Loading branch information
w-taek committed Nov 1, 2022
1 parent 9996248 commit 83d67f8
Show file tree
Hide file tree
Showing 68 changed files with 1,534 additions and 0 deletions.
8 changes: 8 additions & 0 deletions PROJECT221019/.idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions PROJECT221019/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions PROJECT221019/.idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

124 changes: 124 additions & 0 deletions PROJECT221019/.idea/uiDesigner.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions PROJECT221019/.idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions PROJECT221019/PROJECT221019.iml
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.
20 changes: 20 additions & 0 deletions PROJECT221019/src/BorderLayoutEx.java
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();
}
}
19 changes: 19 additions & 0 deletions PROJECT221019/src/ContentPaneEx.java
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();
}
}
20 changes: 20 additions & 0 deletions PROJECT221019/src/FlowLayoutEx.java
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();
}
}
25 changes: 25 additions & 0 deletions PROJECT221019/src/GridLayoutEx.java
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();
}
}
26 changes: 26 additions & 0 deletions PROJECT221019/src/Lab08Ex01.java
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();
}
}
24 changes: 24 additions & 0 deletions PROJECT221019/src/Lab08Ex02.java
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();
}
}
22 changes: 22 additions & 0 deletions PROJECT221019/src/Lab08Ex03.java
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();
}
}
28 changes: 28 additions & 0 deletions PROJECT221019/src/Lab08Ex04.java
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();
}
}
Loading

0 comments on commit 83d67f8

Please sign in to comment.