일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- git flow
- html id
- hyperledger transaction
- docker example
- #android activity
- html plug-in
- border-box
- #1차원배열
- html video
- html multimedia
- mac terminal command
- #2차원배열
- #성적관리프로그램
- #자바상속#자바이즈어#is~a
- relative path
- #binary
- #bubbleSort
- #3차원배열
- html youtube
- 하이퍼레저패브릭
- html object
- #C++ 연산자함수오버로딩
- #CallByAddress
- 토큰경제
- #다차원포인터
- html5 new tag
- html charset
- html code
- #C++ has~a
- #JAVASCRIPT
- Today
- Total
A sentimental robot
Chatting UI 본문
package Pack01;
import javafx.scene.control.Button;
import javafx.scene.control.TextArea;
import javafx.scene.control.TextField;
import javafx.application.Application;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.Scene;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
public class Hello extends Application {
@Override
public void start(Stage arg0) throws Exception {
VBox vbox = new VBox();
vbox.setPrefSize(300, 300);
// --------------- code
Button btn1 = new Button("Conversation Start");
TextField text = new TextField();
TextArea textArea = new TextArea();
text.setOnAction(new EventHandler<>() {
@Override
public void handle(ActionEvent arg0) {
String s = text.getText();
textArea.appendText("User: " + s + "\n");
text.setText(" ");
btn1.setVisible(false);
}
});
vbox.getChildren().addAll(btn1, text, textArea);
// ---------------
Scene scene = new Scene(vbox);
arg0.setScene(scene);
arg0.setTitle("server");
arg0.show();
}
public static void main(String[] args) {
launch();
}
}
'Java' 카테고리의 다른 글
NullPointerException (0) | 2018.06.30 |
---|---|
Platform.runLater( ) (0) | 2018.02.07 |
UI (0) | 2018.02.07 |
진수에 대해서 (0) | 2018.01.09 |
객체참조 (0) | 2018.01.09 |