Fast Food Desktop application in javafx complete source code

FXMLDocument.fxml

<?xml version="1.0" encoding="UTF-8"?>

<?import com.jfoenix.controls.JFXButton?>
<?import javafx.scene.image.Image?>
<?import javafx.scene.image.ImageView?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.Pane?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.text.Font?>
<?import javafx.scene.text.Text?>

<AnchorPane id="AnchorPane" fx:id="root" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" onMouseClicked="#closed" prefHeight="695.0" prefWidth="1148.0" xmlns="http://javafx.com/javafx/8.0.141" xmlns:fx="http://javafx.com/fxml/1" fx:controller="fastfoodd.FXMLDocumentController">
   <children>
      <VBox fx:id="box" prefHeight="695.0" prefWidth="234.0" styleClass="box" stylesheets="@style.css">
         <children>
            <Pane prefHeight="67.0" prefWidth="234.0" />
            <JFXButton fx:id="btn" onAction="#btn_home" prefHeight="54.0" prefWidth="235.0" styleClass="btn" stylesheets="@style.css" text="             Home" textFill="#ebe7e7">
               <font>
                  <Font name="Candara Bold" size="20.0" />
               </font>
               <graphic>
                  <ImageView fitHeight="41.0" fitWidth="41.0" pickOnBounds="true" preserveRatio="true">
                     <image>
                        <Image url="@../../images/Monitor_48px.png" />
                     </image>
                  </ImageView>
               </graphic>
            </JFXButton>
            <JFXButton fx:id="btn1" layoutX="10.0" layoutY="77.0" onAction="#btn_eatin" prefHeight="54.0" prefWidth="235.0" styleClass="btn" text="              Eat-In" textFill="#ebe7e7">
               <font>
                  <Font name="Candara Bold" size="20.0" />
               </font>
               <graphic>
                  <ImageView fitHeight="41.0" fitWidth="41.0" pickOnBounds="true" preserveRatio="true">
                     <image>
                        <Image url="@../../images/2%20(2).png" />
                     </image>
                  </ImageView>
               </graphic>
            </JFXButton>
            <JFXButton fx:id="btn2" layoutX="10.0" layoutY="132.0" prefHeight="54.0" prefWidth="235.0" styleClass="btn" text="       Collection" textFill="#ebe7e7">
               <font>
                  <Font name="Candara Bold" size="20.0" />
               </font>
               <graphic>
                  <ImageView fitHeight="41.0" fitWidth="41.0" pickOnBounds="true" preserveRatio="true">
                     <image>
                        <Image url="@../../images/3.png" />
                     </image>
                  </ImageView>
               </graphic>
            </JFXButton>
            <JFXButton fx:id="btn3" layoutX="10.0" layoutY="77.0" prefHeight="54.0" prefWidth="235.0" styleClass="btn" text="            Delivery" textFill="#ebe7e7">
               <font>
                  <Font name="Candara Bold" size="20.0" />
               </font>
               <graphic>
                  <ImageView fitHeight="41.0" fitWidth="41.0" pickOnBounds="true" preserveRatio="true">
                     <image>
                        <Image url="@../../images/4.png" />
                     </image>
                  </ImageView>
               </graphic>
            </JFXButton>
            <JFXButton fx:id="btn4" layoutX="10.0" layoutY="132.0" prefHeight="54.0" prefWidth="235.0" styleClass="btn" text="      Take Away" textFill="#ebe7e7">
               <font>
                  <Font name="Candara Bold" size="20.0" />
               </font>
               <graphic>
                  <ImageView fitHeight="41.0" fitWidth="41.0" pickOnBounds="true" preserveRatio="true">
                     <image>
                        <Image url="@../../images/5.png" />
                     </image>
                  </ImageView>
               </graphic>
            </JFXButton>
            <JFXButton fx:id="btn5" layoutX="10.0" layoutY="187.0" prefHeight="54.0" prefWidth="235.0" styleClass="btn" text="Driver Payment" textFill="#ebe7e7">
               <font>
                  <Font name="Candara Bold" size="20.0" />
               </font>
               <graphic>
                  <ImageView fitHeight="41.0" fitWidth="41.0" pickOnBounds="true" preserveRatio="true">
                     <image>
                        <Image url="@../../images/6.png" />
                     </image>
                  </ImageView>
               </graphic>
            </JFXButton>
            <JFXButton fx:id="btn6" layoutX="10.0" layoutY="352.0" prefHeight="54.0" prefWidth="235.0" styleClass="btn" text="         Customers" textFill="#ebe7e7">
               <font>
                  <Font name="Candara Bold" size="20.0" />
               </font>
               <graphic>
                  <ImageView fitHeight="41.0" fitWidth="41.0" pickOnBounds="true" preserveRatio="true">
                     <image>
                        <Image url="@../../images/7.png" />
                     </image>
                  </ImageView>
               </graphic>
            </JFXButton>
            <Pane prefHeight="244.0" prefWidth="234.0">
               <children>
                  <ImageView fitHeight="31.0" fitWidth="42.0" layoutX="26.0" layoutY="199.0" pickOnBounds="true" preserveRatio="true">
                     <image>
                        <Image url="@../../images/l.png" />
                     </image>
                  </ImageView>
               </children>
            </Pane>
         </children>
      </VBox>
      <HBox fx:id="boxx" layoutX="234.0" prefHeight="13.0" prefWidth="915.0" styleClass="boxx" stylesheets="@style.css" />
      <Text layoutX="348.0" layoutY="43.0" strokeType="OUTSIDE" strokeWidth="0.0" text="Designing By Wajid Hussain" wrappingWidth="204.13671875">
         <font>
            <Font size="16.0" />
         </font>
      </Text>
      <ImageView fitHeight="21.0" fitWidth="31.0" layoutX="586.0" layoutY="26.0" pickOnBounds="true" preserveRatio="true">
         <image>
            <Image url="@../../images/Facebook_48px.png" />
         </image>
      </ImageView>
      <ImageView fitHeight="21.0" fitWidth="31.0" layoutX="615.0" layoutY="26.0" pickOnBounds="true" preserveRatio="true">
         <image>
            <Image url="@../../images/Twitter_50px.png" />
         </image>
      </ImageView>
      <ImageView fitHeight="21.0" fitWidth="31.0" layoutX="643.0" layoutY="26.0" pickOnBounds="true" preserveRatio="true">
         <image>
            <Image url="@../../images/6.png" />
         </image>
      </ImageView>
      <ImageView fx:id="close" fitHeight="31.0" fitWidth="31.0" layoutX="1109.0" layoutY="16.0" pickOnBounds="true" preserveRatio="true">
         <image>
            <Image url="@../../images/Shutdown_48px.png" />
         </image>
      </ImageView>
      <ImageView fitHeight="31.0" fitWidth="31.0" layoutX="1074.0" layoutY="17.0" pickOnBounds="true" preserveRatio="true">
         <image>
            <Image url="@../../images/Appointment%20Reminders_48px.png" />
         </image>
      </ImageView>
      <ImageView fitHeight="31.0" fitWidth="31.0" layoutX="1039.0" layoutY="18.0" pickOnBounds="true" preserveRatio="true">
         <image>
            <Image url="@../../images/Settings_48px_1.png" />
         </image>
      </ImageView>
      <Text fill="#eb9b10" layoutX="348.0" layoutY="179.0" strokeType="OUTSIDE" strokeWidth="0.0" text="Only" wrappingWidth="40.13671875">
         <font>
            <Font name="Calibri Bold" size="18.0" />
         </font>
      </Text>
      <Text fill="#aba620" layoutX="383.0" layoutY="256.0" strokeType="OUTSIDE" strokeWidth="0.0" text="\$250" wrappingWidth="252.13671875">
         <font>
            <Font name="Calibri Bold" size="96.0" />
         </font>
      </Text>
      <Text layoutX="383.0" layoutY="301.0" strokeType="OUTSIDE" strokeWidth="0.0" text="Cheeseburger" wrappingWidth="293.13671875">
         <font>
            <Font size="26.0" />
         </font>
      </Text>
      <Text layoutX="385.0" layoutY="328.0" strokeType="OUTSIDE" strokeWidth="0.0" text="With Onions and Tamato and Ketchep" wrappingWidth="376.13671875">
         <font>
            <Font size="16.0" />
         </font>
      </Text>
      <Text layoutX="382.0" layoutY="355.0" strokeType="OUTSIDE" strokeWidth="0.0" text="Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmodtempor incididunt ut labore et dolore magna aliqua. Ut enim &#10;ad minim veniam,quis nostrud exercitation ullamco laboris nisi ut " wrappingWidth="376.13671875">
         <font>
            <Font size="16.0" />
         </font>
      </Text>
      <JFXButton layoutX="388.0" layoutY="512.0" onAction="#order" prefHeight="48.0" prefWidth="368.0" style="-fx-background-color: #eb9b10;" text="Order Now" textFill="#eeeee9">
         <font>
            <Font size="18.0" />
         </font>
      </JFXButton>
      <ImageView fitHeight="379.0" fitWidth="344.0" layoutX="779.0" layoutY="235.0" pickOnBounds="true" preserveRatio="true">
         <image>
            <Image url="@../../images/2157ea7887c768c.jpg" />
         </image>
      </ImageView>
   </children>
</AnchorPane>


style.css


.box{
    -fx-background-color: #5A5A5A;
}
.boxx{
    -fx-background-color: FF2A00;
}

.btn:hover{
    /*-fx-background-color: #0033ff;*/
    -fx-border-color: FF2A00;
    -fx-border-width: 0px 0px 0px 6px;
    -fx-border-style: solid;
}




package fastfoodd;

import com.jfoenix.controls.JFXButton;
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;
import javafx.scene.image.ImageView;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.HBox;
import javafx.scene.layout.VBox;


public class FXMLDocumentController implements Initializable {
    
    @FXML
    private AnchorPane root;
    @FXML
    private VBox box;
    @FXML
    private JFXButton btn;
    @FXML
    private JFXButton btn1;
    @FXML
    private JFXButton btn2;
    @FXML
    private JFXButton btn3;
    @FXML
    private JFXButton btn4;
    @FXML
    private JFXButton btn5;
    @FXML
    private JFXButton btn6;
    @FXML
    private HBox boxx;
    @FXML
    private ImageView close;
    
  
    

package fastfoodd;

import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;
import javafx.stage.StageStyle;

Fastfood.java

public class Fastfoodd extends Application {
    
    @Override
    public void start(Stage stage) throws Exception {
        Parent root = FXMLLoader.load(getClass().getResource("FXMLDocument.fxml"));
        
        Scene scene = new Scene(root);
        stage.initStyle(StageStyle.TRANSPARENT);
        stage.setScene(scene);
        stage.show();
    }

   
    public static void main(String[] args) {
        launch(args);
    }
    
}


Comments

Popular posts from this blog

JavaFX UI /UX Dashboard

JavaFX code for responsive layout