javafx fxml form javascript css Example
来源:互联网 发布:cf冰龙刷枪软件 编辑:程序博客网 时间:2024/06/08 06:34
FXMLDocument.fxml<?xml version="1.0" encoding="UTF-8"?><?language javascript?><?import java.net.*?><?import javafx.geometry.*?><?import javafx.scene.control.*?><?import javafx.scene.layout.*?><?import javafx.scene.text.*?><!--<AnchorPane id="AnchorPane" prefHeight="200" prefWidth="320" xmlns:fx="http://javafx.com/fxml/1" fx:controller="fxmlexample.FXMLDocumentController"> <children> <Button layoutX="126" layoutY="90" text="Click Me!" onAction="#handleButtonAction" fx:id="button" /> <Label layoutX="126" layoutY="120" minHeight="16" minWidth="69" fx:id="label" /> </children></AnchorPane>--><GridPane fx:controller="fxmlexample.FXMLExampleController" xmlns:fx="http://javafx.com/fxml" alignment="center" hgap="10" vgap="10" styleClass="root" > <padding> <Insets top="25" right="25" bottom="10" left="25"/> </padding> <Text text="Welcome" GridPane.columnIndex="0" GridPane.rowIndex="0" GridPane.columnSpan="2"/> <Label text="User Name:" GridPane.columnIndex="0" GridPane.rowIndex="1"/> <TextField GridPane.columnIndex="1" GridPane.rowIndex="1"/> <Label text="Password:" GridPane.columnIndex="0" GridPane.rowIndex="2"/> <PasswordField fx:id="passwordField" GridPane.columnIndex="1" GridPane.rowIndex="2"/> <HBox spacing="10" alignment="bottom_right" GridPane.columnIndex="1" GridPane.rowIndex="4"> <Button text="Sign In" onAction="handleSubmitButtonAction(event);"/> </HBox> <Text fx:id="actiontarget" GridPane.columnIndex="0" GridPane.columnSpan="2" GridPane.halignment="RIGHT" GridPane.rowIndex="6"/> <stylesheets> <URL value="@Login.css" /> </stylesheets> <Text id="welcome-text" text="Welcome" GridPane.columnIndex="0" GridPane.rowIndex="0" GridPane.columnSpan="2"/> <fx:script> function handleSubmitButtonAction() { actiontarget.setText("Calling the JavaScript"); } </fx:script></GridPane>
FXMLDocumentController.java/* * 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 fxmlexample;import javafx.event.ActionEvent;import javafx.fxml.FXML;import javafx.scene.text.Text;/** * * @author L */public class FXMLExampleController { @FXML private Text actiontarget; @FXML protected void handleSubmitButtonAction(ActionEvent event) { actiontarget.setText("Sign in button pressed"); }}
Login.css/*To change this license header, choose License Headers in Project Properties.To change this template file, choose Tools | Templatesand open the template in the editor.*//* Created on : Nov 18, 2015, 4:59:48 PM Author : L*/.root { -fx-background-image: url("Tulips.jpg");}.label { -fx-font-size: 12px; -fx-font-weight: bold; -fx-text-fill: #333333; -fx-effect: dropshadow( gaussian , rgba(255,255,255,0.5) , 0,0,0,1 );}#welcome-text { -fx-font-size: 32px; -fx-font-family: "Arial Black"; -fx-fill: #818181; -fx-effect: innershadow( three-pass-box , rgba(0,0,0,0.7) , 6, 0.0 , 0 , 2 );}#actiontarget { -fx-fill: FIREBRICK; -fx-font-weight: bold; -fx-effect: dropshadow( gaussian , rgba(255,255,255,0.5) , 0,0,0,1 ); }.button { -fx-text-fill: white; -fx-font-family: "Arial Narrow"; -fx-font-weight: bold; -fx-background-color: linear-gradient(#61a2b1, #2A5058); -fx-effect: dropshadow( three-pass-box , rgba(0,0,0,0.6) , 5, 0.0 , 0 , 1 );}.button:hover { -fx-background-color: linear-gradient(#2A5058, #61a2b1);}
0 0
- javafx fxml form javascript css Example
- JavaFX-FXML
- javafx之FXML初探
- JavaFx初探 fxml
- javafx中的控制器和fxml
- Combo Box JavaFx with FXML
- Combo Box JavaFx with FXML
- javafx fxml之右键菜单
- javafx fxml 最简示例
- JavaFX入门(二):JavaFX和FXML
- Javafx利用fxml的方式添加对话框
- JavaFX学习之道:FXML入门
- Swing中嵌入Fxml方式的JavaFX
- javaFX——基于FXML创建用户界面
- 使用Fxml作为界面的javafx
- javafx加载不同包中的fxml文件
- javafx form
- FXML + CSS 开发登陆界面
- 设计模式:Java 建造者模式(Builder)
- Java正则表达式的语法与示例
- 用步进正弦激励法测量计算机声卡输出输入幅值频响函数
- [转载]复杂网络资源
- 怎么下载微信或优酷等网站的视频
- javafx fxml form javascript css Example
- AndroidManifest.xml文件详解(uses-feature)
- Spring_Security_3.0.1 中文参考文档chapter 6 核心服务
- html弹出层
- 数据结构的栈和堆
- CookieAuthenticationOptions类 (MVC身份验证)
- mkdir , rmdir ,rm,cp ,mv的使用方法,
- SQLITE删除表中所有数据方法
- java小面试题