comparison src/main/java/ac/ryukyu/treevnc/client/TextBoxClient.java @ 2:dca3bd61b830

before change MyVncClient.java
author Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
date Mon, 09 Jul 2012 18:47:33 +0900
parents 75b54fd9e73a
children
comparison
equal deleted inserted replaced
1:75b54fd9e73a 2:dca3bd61b830
36 } 36 }
37 37
38 public void ipRegister() { 38 public void ipRegister() {
39 setSize(); 39 setSize();
40 setText(); 40 setText();
41 setButton();
41 visible(); 42 visible();
42 } 43 }
43 44
44 private void setSize() { 45 private void setSize() {
45 Dimension d = Toolkit.getDefaultToolkit().getScreenSize(); 46 Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
46 width = (d.getWidth() / 2); 47 width = (d.getWidth() / 2);
47 height = (d.getHeight() / 2); 48 height = (d.getHeight() / 2);
48 } 49 }
49 50
50 void visible() { 51 public void visible() {
51 Point point = new Point(); 52 Point point = new Point();
52 point.setLocation(width - 250, height - 80); 53 point.setLocation(width - 250, height - 80);
53 setLocation(point.getLocation()); 54 setLocation(point.getLocation());
54 pack(); 55 pack();
55 setVisible(true); 56 setVisible(true);
57 58
58 public void unVisible() { 59 public void unVisible() {
59 setVisible(false); 60 setVisible(false);
60 } 61 }
61 62
62 private void setText() { 63 private void setText() {
63 t1 = new TextField("Address", 30); 64 t1 = new TextField("Address", 30);
64 t2 = new TextField("5999", 5); 65 t2 = new TextField("5999", 5);
65 panel.add(t1); 66 panel.add(t1);
66 panel.add(t2); 67 panel.add(t2);
67 panel.add(button); 68 //panel.add(button);
68 button.addActionListener(this); 69 //button.addActionListener(this);
69 label = new JLabel(); 70 label = new JLabel();
70 Container contentPane = getContentPane(); 71 Container contentPane = getContentPane();
71 contentPane.add(panel, BorderLayout.CENTER); 72 contentPane.add(panel, BorderLayout.CENTER);
72 contentPane.add(label, BorderLayout.SOUTH); 73 contentPane.add(label, BorderLayout.SOUTH);
73 } 74 }
74 75
75 void checkBox(String str) { 76 public void checkBox(String str) {
76 // CheckboxGroup ch = new CheckboxGroup(); 77 // CheckboxGroup ch = new CheckboxGroup();
77 if (counter == 0) 78 if (counter == 0)
78 check[counter] = new Checkbox(str, true, ch); 79 check[counter] = new Checkbox(str, true, ch);
79 else 80 else
80 check[counter] = new Checkbox(str, false, ch); 81 check[counter] = new Checkbox(str, false, ch);
145 return port; 146 return port;
146 // return t2.getText(); 147 // return t2.getText();
147 } 148 }
148 149
149 public void actionPerformed(ActionEvent e) { 150 public void actionPerformed(ActionEvent e) {
151 System.out.println("Action");
150 flag = true; 152 flag = true;
151 for (int t = 0; t < counter; t++) { 153 for (int t = 0; t < counter; t++) {
152 if (check[t].getState()) { 154 if (check[t].getState()) {
153 System.out.println(check[t].getLabel()); 155 System.out.println(check[t].getLabel());
154 // if(int t =0) 156 // if(int t =0)