Skip to content

Instantly share code, notes, and snippets.

@mehmetbebek
Created July 14, 2014 13:22
Show Gist options
  • Save mehmetbebek/f4b0e6fdb8c80b543a4b to your computer and use it in GitHub Desktop.
Save mehmetbebek/f4b0e6fdb8c80b543a4b to your computer and use it in GitHub Desktop.
Fazilet Calendar
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package takvim;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.HBox;
import javafx.scene.paint.Color;
import javafx.stage.Stage;
import javafx.stage.StageStyle;
/**
*
* @author m00264122
*/
public class Takvim extends Application {
@Override
public void start(Stage stage) throws Exception {
stage.initStyle(StageStyle.TRANSPARENT);
ImageView close;
AnchorPane root = (AnchorPane)FXMLLoader.load(getClass().getResource("FXMLDocument.fxml"));
// Parent root = FXMLLoader.load(getClass().getResource("FXMLDocument.fxml"));
root.setId("pane");
// Image image = new Image("/button.png", 100, 150, false, false);
// ImageView iv1 = new ImageView();
// iv1.setImage(image);
// HBox box = new HBox();
// box.getChildren().add(iv1);
//
// root.getChildren().add(box);
Image i = new Image("/button.png");
close = new ImageView();
close.setImage(i);
close.setFitHeight(49);
close.setFitWidth(52);
close.setX(220);
close.setY(430);
root.getChildren().add(close);
Scene scene = new Scene(root,512,512,Color.TRANSPARENT);
scene.getStylesheets().addAll(this.getClass().getResource("style.css").toExternalForm());
stage.setScene(scene);
stage.show();
}
public static void main(String[] args) {
launch(args);
}
}
<?xml version="1.0" encoding="UTF-8"?>
<?import java.lang.*?>
<?import java.util.*?>
<?import javafx.scene.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<?import javafx.scene.image.*?>
<AnchorPane xmlns:fx="http://javafx.com/fxml/1" id="AnchorPane" prefHeight="200" prefWidth="320" xmlns:fx="http://javafx.com/fxml" fx:controller="takvim.FXMLDocumentController">
<children>
<!--<Button layoutX="220" layoutY="430" text="Click Me!" onAction="#handleButtonAction" fx:id="button" />-->
<!--<Label layoutX="126" layoutY="120" minHeight="16" minWidth="69" fx:id="label" />-->
</children>
</AnchorPane>
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package takvim;
import java.net.URL;
import java.util.ResourceBundle;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.Label;
/**
*
* @author m00264122
*/
public class FXMLDocumentController implements Initializable {
@FXML
private Label label;
@FXML
private void handleButtonAction(ActionEvent event) {
System.out.println("You clicked me!");
label.setText("Hello World!");
}
@Override
public void initialize(URL url, ResourceBundle rb) {
// TODO
}
}
/*
Created on : Jul 14, 2014, 10:57:04 AM
Author : m00264122
*/
#pane{
-fx-background-image: url("2.png");
-fx-background-repeat: stretch;
-fx-background-size: 512 512;
-fx-background-position: center center;
-fx-effect: dropshadow(three-pass-box, transparent, 0, 0, 0, 0);
}
.button {
-fx-effect: dropshadow(three-pass-box, transparent, 0, 0, 0, 0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment