파워java28 [파워자바] 25장 프로그래밍 솔루션 답지 1. import java.io.*; import java.awt.*; import java.awt.event.*; import java.net.*; import javax.swing.*; class JEditorPaneFrame extends JFrame implements ActionListener{ private JTextField text; private JEditorPane edPane; private JScrollPane scroll; public JEditorPaneFrame(){ setTitle("JEditorPane"); setSize(700,700); edPane = new JEditorPane(); scroll = new JScrollPane(edPane); text = new JTe.. 2023. 2. 16. [파워자바] 24장 프로그래밍 솔루션 답지 1. (1) import java.io.*; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; public class Test { public static void main(String[] args) { ArrayList list = new ArrayList(); try { FileReader fr = new FileReader("input.txt"); BufferedReader br = new BufferedReader(fr); while (true) { String line = br.readLine(); if (line == null) break; int value = Integer.parseInt(li.. 2023. 2. 16. [파워자바] 23장 프로그래밍 솔루션 답지 1. import java.awt.BorderLayout; import java.awt.Color; import java.awt.Font; import java.awt.Graphics; import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.text.DecimalFormat; import javax.swing.JButton; import javax.swing.JComponent; import javax.swing.JFrame; imp.. 2023. 2. 16. [파워자바] 22장 프로그래밍 솔루션 답지 1. import java.util.*; public class RandomList { Random r = new Random(); String[] sample = {"i", "walk", "the", "line"}; List list = (List) Arrays.asList(sample); public void add(T item){ list.add(item); } public T select() { int num = r.nextInt(list.size()); return list.get(num); } } 2. class MyMath { double v=0.0; public double getAverage(T[] a){ for (int i = 0; i < a.length; i++) v = v + a[i.. 2023. 2. 16. 이전 1 2 3 4 5 ··· 7 다음