☕ Java

    Java Notice-Board

    Java Notice-Board

    1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 12..

    명품 자바 에센셜 12장 실습 문제

    명품 자바 에센셜 12장 실습 문제

    Question 1. Thread 클래스를 상속받아 실행 시작 10초 후에 자동으로 종료하는 스레드를 작성하라. 스레드가 실행을 시작하면 타이틀 바에 "실행 시작"이라고 출력하고, 컨텐트팬의 바탕색은 노란색으로 하라. 스레드는 종료 직전 타이틀 바에 "실행 종료"라고 출력하고 바탕을 파란색으로 변경하라. 코드 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 import java.awt.*; import javax.swing.*; public class Question1 extends JFrame { public Question1() { this.setTitle(""); this.setDe..

    명품 자바 에센셜 11장 실습 문제

    명품 자바 에센셜 11장 실습 문제

    Question 1. 다음과 같이 출력하는 프로그램을 작성하라. (1) 삼색원 코드 import java.awt.*; import javax.swing.*; public class Question1 extends JFrame{ public Question1() { this.setTitle(""); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); this.setLocationRelativeTo(getOwner()); this.setContentPane(new MyPanel()); this.setSize(200, 200); this.setVisible(true); } private class MyPanel extends JPanel { public void pa..

    명품 자바 에센셜 10장 실습 문제

    명품 자바 에센셜 10장 실습 문제

    Question1. 다음과 같이 자기가 좋아하는 이미지 4개를 출력하는 프로그램을 작성하라. GridLayout을 이용하고, 4개의 JLabel로 각 이미지를 출력하면 된다. 코드 import java.awt.*; import javax.swing.*; import java.awt.event.*; public class Question1 extends JFrame{ private JLabel [] label = new JLabel[4]; private ImageIcon [] ii = { new ImageIcon("images/apple.jpg"), new ImageIcon("images/banana.jpg"), new ImageIcon("images/cherry.jpg"), new ImageIcon("i..