Skip to content

Instantly share code, notes, and snippets.

@CaelumF
CaelumF / Controller.java
Last active March 31, 2024 17:24
Java 8 Tuturial: First stage, simple FXML program
package sample;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.TextArea;
import javafx.scene.control.TextField;
import java.net.URL;
import java.util.ResourceBundle;
@CaelumF
CaelumF / Controller.java
Last active November 5, 2016 01:29
After exercise, working(simple) IRC client with JavaFX UI
public class Controller extends PircBot implements Initializable{
@FXML
TextArea textArea;
@FXML
TextField textField;
public void onTextFieldAction(){
textArea.setText(textArea.getText() + "\n" + textField.getText());
sendMessage("##CoderdojoBots", textField.getText()); //Sends message
textField.clear(); // Clears input field