import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.scene.control.Alert;
import javafx.scene.control.Label;
import javafx.scene.control.TableColumn;
import javafx.scene.control.TableView;
import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.BorderPane;
import javafx.util.Duration;
import sample.DataAccsesObject.DataAccsesObject;
import sample.Modellar.Telefon;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
public class Asosiy {
@FXML
private Label vaqt;
@FXML
private Label sana;
@FXML
private JFXButton tolov;
@FXML
private JFXButton hodim;
@FXML
private JFXButton guruh;
private void getSoat(){
Timeline timeline=new Timeline(new KeyFrame(Duration.seconds(0), new EventHandler() {
@Override
public void handle(ActionEvent event) {
Calendar calendar=Calendar.getInstance();
SimpleDateFormat dateFormat=new SimpleDateFormat("HH:mm:ss");
vaqt.setText(dateFormat.format(calendar.getTime()));
}
}),new KeyFrame(Duration.seconds(1)));
timeline.setCycleCount(Animation.INDEFINITE);
timeline.play();
}
private void getSana(){
Date date=new Date();
SimpleDateFormat dateFormat=new SimpleDateFormat("dd:MM:yyyy");
this.sana.setText(dateFormat.format(date));
}
@FXML
private BorderPane root;
Navigation navigation=new Navigation();
@FXML
void handle_mahsulot(ActionEvent event) throws IOException {
AnchorPane anchorPane=(AnchorPane)FXMLLoader.load(getClass().getResource(navigation.getMahsulotController()));
root.setCenter(anchorPane);
}
@FXML
void handle_sozlamalar(ActionEvent event) throws IOException {
AnchorPane anchorPane=(AnchorPane)FXMLLoader.load(getClass().getResource(navigation.getSozlamalarAsosiy()));
root.setCenter(anchorPane);
}
@FXML
Do'stlaringiz bilan baham: |