Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Main
- package Queuefx;
- import javafx.application.Application;
- import javafx.fxml.FXMLLoader;
- import javafx.scene.Scene;
- import javafx.scene.layout.AnchorPane;
- import javafx.stage.Stage;
- import java.io.IOException;
- public class Main extends Application {
- Stage stage;
- @Override
- public void start(Stage primaryStage) throws Exception{
- this.stage=primaryStage;
- StartQueue();
- }
- public void StartQueue(){
- try {
- FXMLLoader loader = new FXMLLoader(Main.class.getResource("../fxmls/ui.fxml"));
- AnchorPane pane = loader.load();
- Scene scene = new Scene(pane);
- stage.setTitle("Login");
- stage.setResizable(false);
- stage.setScene(scene);
- stage.show();
- } catch (
- IOException e){
- e.printStackTrace();
- }
- }
- public static void main(String[] args) {
- launch(args);
- }
- }
- //QueueController
- package Queuefx;
- import javafx.animation.Animation;
- import javafx.animation.KeyFrame;
- import javafx.animation.Timeline;
- import javafx.beans.property.StringProperty;
- import javafx.event.ActionEvent;
- import javafx.fxml.FXML;
- import javafx.fxml.FXMLLoader;
- import javafx.fxml.Initializable;
- import javafx.scene.Node;
- import javafx.scene.Parent;
- import javafx.scene.Scene;
- import javafx.scene.control.Button;
- import javafx.scene.control.Label;
- import javafx.scene.layout.Pane;
- import javafx.stage.Stage;
- import javafx.util.Duration;
- import java.io.IOException;
- import java.net.URL;
- import java.text.DateFormat;
- import java.text.SimpleDateFormat;
- import java.time.LocalDateTime;
- import java.util.Calendar;
- import java.util.Date;
- import java.util.ResourceBundle;
- import java.util.logging.Level;
- import java.util.logging.Logger;
- public class Queuecontroller implements Initializable{
- int count;
- String sum;
- @FXML
- private Button Reset;
- @FXML
- private Button Next;
- @FXML
- private Button previous;
- @FXML
- private Button back;
- @FXML
- public static Label counter;
- @FXML
- public void handleNext(ActionEvent event) throws IOException {
- }
- @FXML
- public void handlePrevious(ActionEvent event) throws IOException {
- }
- @FXML
- public void handleReset(ActionEvent event) throws IOException {
- }
- @FXML
- public void handleback(ActionEvent event) throws IOException {
- Parent quel = FXMLLoader.load(getClass().getResource("/fxmls/dash.fxml"));
- Scene disp = new Scene(quel);
- Stage win1 = (Stage) ((Node) event.getSource()).getScene().getWindow();
- win1.setResizable(false);
- win1.setScene(disp);
- win1.show();
- }
- @Override
- public void initialize(URL location, ResourceBundle resources) {
- }
- }
- //Display Controller
- package Queuefx;
- import javafx.animation.Animation;
- import javafx.animation.KeyFrame;
- import javafx.animation.Timeline;
- import javafx.fxml.FXML;
- import javafx.fxml.Initializable;
- import javafx.scene.control.Label;
- import javafx.util.Duration;
- import java.net.URL;
- import java.text.DateFormat;
- import java.text.SimpleDateFormat;
- import java.time.LocalDateTime;
- import java.util.Calendar;
- import java.util.Date;
- import java.util.ResourceBundle;
- public class Displaycontroller {
- private int minutes;
- private int hours;
- private int seconds;
- Date d = new Date();
- @FXML
- public static Label counterr;
- @FXML
- private Label time;
- @FXML
- private Label date;
- @FXML
- public void initialize() {
- DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss a");
- DateFormat aFormat = new SimpleDateFormat("MM-d-yyyy");
- Calendar cal = Calendar.getInstance();
- Timeline clock = new Timeline(new KeyFrame(Duration.ZERO, e -> {
- seconds = LocalDateTime.now().getSecond();
- minutes = LocalDateTime.now().getMinute();
- hours = LocalDateTime.now().getHour();
- date.setText(aFormat.format(d));
- time.setText(hours + ":" + (minutes) + ":" + seconds);
- }),
- new KeyFrame(Duration.seconds(1))
- );
- clock.setCycleCount(Animation.INDEFINITE);
- clock.play();
- }
- public void sets(String a){
- counterr.setText(a);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement