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
| import java.awt.*;
public class Round17_Ex02 { public static void main(String[] ar) { Round17_Ex02_Sub round = new Round17_Ex02_Sub(); } }
class Round17_Ex02_Sub extends Frame { private Dimension dimen, dimen1; private int xpos, ypos; private Label lb1 = new Label("Test"); private Label lb2 = new Label("Test1");
public Round17_Ex02_Sub() { super("제목넣기"); this.init(); this.start(); this.setSize(300, 200); dimen = Toolkit.getDefaultToolkit().getScreenSize(); dimen1 = this.getSize(); xpos = (int) (dimen.getWidth() / 2 - dimen1.getWidth() / 2); ypos = (int) (dimen.getHeight() / 2 - dimen1.getHeight() / 2); this.setLocation(xpos, ypos); this.setVisible(true); }
public void init() { Color c1 = new Color(218, 185, 5); Color c2 = new Color(117, 11, 213); Color c3 = new Color(255, 255, 255); this.setBackground(c1); FlowLayout flow = new FlowLayout(); this.setLayout(flow); lb1.setBackground(c2); lb2.setForeground(c3); this.add(lb); }
public void start() { } }
|