@ -0,0 +1,53 @@
@@ -0,0 +1,53 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?><!-- You may freely edit this file. See commented blocks below for --><!-- some examples of how to customize the build. --><!-- (If you delete it and reopen the project it will be recreated.) --><!-- By default, only the Clean and Build commands use this build script. --><project name="PropetiesFx" default="default" basedir="." xmlns:fx="javafx:com.sun.javafx.tools.ant"> |
||||
<description>Builds, tests, and runs the project PropetiesFx.</description> |
||||
<import file="nbproject/build-impl.xml"/> |
||||
<!-- |
||||
|
||||
There exist several targets which are by default empty and which can be |
||||
used for execution of your tasks. These targets are usually executed |
||||
before and after some main targets. Those of them relevant for JavaFX project are: |
||||
|
||||
-pre-init: called before initialization of project properties |
||||
-post-init: called after initialization of project properties |
||||
-pre-compile: called before javac compilation |
||||
-post-compile: called after javac compilation |
||||
-pre-compile-test: called before javac compilation of JUnit tests |
||||
-post-compile-test: called after javac compilation of JUnit tests |
||||
-pre-jfx-jar: called before FX SDK specific <fx:jar> task |
||||
-post-jfx-jar: called after FX SDK specific <fx:jar> task |
||||
-pre-jfx-deploy: called before FX SDK specific <fx:deploy> task |
||||
-post-jfx-deploy: called after FX SDK specific <fx:deploy> task |
||||
-pre-jfx-native: called just after -pre-jfx-deploy if <fx:deploy> runs in native packaging mode |
||||
-post-jfx-native: called just after -post-jfx-deploy if <fx:deploy> runs in native packaging mode |
||||
-post-clean: called after cleaning build products |
||||
|
||||
(Targets beginning with '-' are not intended to be called on their own.) |
||||
|
||||
Example of inserting a HTML postprocessor after javaFX SDK deployment: |
||||
|
||||
<target name="-post-jfx-deploy"> |
||||
<basename property="jfx.deployment.base" file="${jfx.deployment.jar}" suffix=".jar"/> |
||||
<property name="jfx.deployment.html" location="${jfx.deployment.dir}${file.separator}${jfx.deployment.base}.html"/> |
||||
<custompostprocess> |
||||
<fileset dir="${jfx.deployment.html}"/> |
||||
</custompostprocess> |
||||
</target> |
||||
|
||||
Example of calling an Ant task from JavaFX SDK. Note that access to JavaFX SDK Ant tasks must be |
||||
initialized; to ensure this is done add the dependence on -check-jfx-sdk-version target: |
||||
|
||||
<target name="-post-jfx-jar" depends="-check-jfx-sdk-version"> |
||||
<echo message="Calling jar task from JavaFX SDK"/> |
||||
<fx:jar ...> |
||||
... |
||||
</fx:jar> |
||||
</target> |
||||
|
||||
For more details about JavaFX SDK Ant tasks go to |
||||
http://docs.oracle.com/javafx/2/deployment/jfxpub-deployment.htm |
||||
|
||||
For list of available properties check the files |
||||
nbproject/build-impl.xml and nbproject/jfx-impl.xml. |
||||
|
||||
--> |
||||
</project> |
@ -0,0 +1,4 @@
@@ -0,0 +1,4 @@
|
||||
#Fri, 10 Feb 2023 21:22:19 +0300 |
||||
|
||||
|
||||
C\:\\Users\\denis.LAPTOP-4LI8UQ4O\\OneDrive\\\u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u044b\\NetBeansProjects\\PropetiesFx= |
@ -0,0 +1,45 @@
@@ -0,0 +1,45 @@
|
||||
<html><head> |
||||
<SCRIPT src="./web-files/dtjava.js"></SCRIPT> |
||||
<script> |
||||
function launchApplication(jnlpfile) { |
||||
dtjava.launch( { |
||||
url : 'PropetiesFx.jnlp', |
||||
jnlp_content : 'PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjxqbmxwIHNwZWM9IjEuMCIgeG1sbnM6amZ4PSJodHRwOi8vamF2YWZ4LmNvbSIgaHJlZj0iUHJvcGV0aWVzRnguam5scCI+DQogIDxpbmZvcm1hdGlvbj4NCiAgICA8dGl0bGU+UHJvcGV0aWVzRng8L3RpdGxlPg0KICAgIDx2ZW5kb3I+ZGVuaXM8L3ZlbmRvcj4NCiAgICA8ZGVzY3JpcHRpb24+bnVsbDwvZGVzY3JpcHRpb24+DQogICAgPG9mZmxpbmUtYWxsb3dlZC8+DQogIDwvaW5mb3JtYXRpb24+DQogIDxyZXNvdXJjZXM+DQogICAgPGoyc2UgdmVyc2lvbj0iMS42KyIgaHJlZj0iaHR0cDovL2phdmEuc3VuLmNvbS9wcm9kdWN0cy9hdXRvZGwvajJzZSIvPg0KICAgIDxqYXIgaHJlZj0iUHJvcGV0aWVzRnguamFyIiBzaXplPSIzNjIxIiBkb3dubG9hZD0iZWFnZXIiIC8+DQogIDwvcmVzb3VyY2VzPg0KICA8YXBwbGV0LWRlc2MgIHdpZHRoPSI4MDAiIGhlaWdodD0iNjAwIiBtYWluLWNsYXNzPSJjb20uamF2YWZ4Lm1haW4uTm9KYXZhRlhGYWxsYmFjayIgIG5hbWU9IlByb3BldGllc0Z4IiA+DQogICAgPHBhcmFtIG5hbWU9InJlcXVpcmVkRlhWZXJzaW9uIiB2YWx1ZT0iOC4wKyIvPg0KICA8L2FwcGxldC1kZXNjPg0KICA8amZ4OmphdmFmeC1kZXNjICB3aWR0aD0iODAwIiBoZWlnaHQ9IjYwMCIgbWFpbi1jbGFzcz0icHJvcGV0aWVzZnguUHJvcGV0aWVzRngiICBuYW1lPSJQcm9wZXRpZXNGeCIgLz4NCiAgPHVwZGF0ZSBjaGVjaz0iYWx3YXlzIi8+DQo8L2pubHA+DQo=' |
||||
}, |
||||
{ |
||||
javafx : '8.0+' |
||||
}, |
||||
{} |
||||
); |
||||
return false; |
||||
} |
||||
</script> |
||||
|
||||
<script> |
||||
function javafxEmbedpropetiesfx() { |
||||
dtjava.embed( |
||||
{ |
||||
id : 'propetiesfx', |
||||
url : 'PropetiesFx.jnlp', |
||||
placeholder : 'javafx-app-placeholder', |
||||
width : '800', |
||||
height : '600', |
||||
jnlp_content : 'PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjxqbmxwIHNwZWM9IjEuMCIgeG1sbnM6amZ4PSJodHRwOi8vamF2YWZ4LmNvbSIgaHJlZj0iUHJvcGV0aWVzRnguam5scCI+DQogIDxpbmZvcm1hdGlvbj4NCiAgICA8dGl0bGU+UHJvcGV0aWVzRng8L3RpdGxlPg0KICAgIDx2ZW5kb3I+ZGVuaXM8L3ZlbmRvcj4NCiAgICA8ZGVzY3JpcHRpb24+bnVsbDwvZGVzY3JpcHRpb24+DQogICAgPG9mZmxpbmUtYWxsb3dlZC8+DQogIDwvaW5mb3JtYXRpb24+DQogIDxyZXNvdXJjZXM+DQogICAgPGoyc2UgdmVyc2lvbj0iMS42KyIgaHJlZj0iaHR0cDovL2phdmEuc3VuLmNvbS9wcm9kdWN0cy9hdXRvZGwvajJzZSIvPg0KICAgIDxqYXIgaHJlZj0iUHJvcGV0aWVzRnguamFyIiBzaXplPSIzNjIxIiBkb3dubG9hZD0iZWFnZXIiIC8+DQogIDwvcmVzb3VyY2VzPg0KICA8YXBwbGV0LWRlc2MgIHdpZHRoPSI4MDAiIGhlaWdodD0iNjAwIiBtYWluLWNsYXNzPSJjb20uamF2YWZ4Lm1haW4uTm9KYXZhRlhGYWxsYmFjayIgIG5hbWU9IlByb3BldGllc0Z4IiA+DQogICAgPHBhcmFtIG5hbWU9InJlcXVpcmVkRlhWZXJzaW9uIiB2YWx1ZT0iOC4wKyIvPg0KICA8L2FwcGxldC1kZXNjPg0KICA8amZ4OmphdmFmeC1kZXNjICB3aWR0aD0iODAwIiBoZWlnaHQ9IjYwMCIgbWFpbi1jbGFzcz0icHJvcGV0aWVzZnguUHJvcGV0aWVzRngiICBuYW1lPSJQcm9wZXRpZXNGeCIgLz4NCiAgPHVwZGF0ZSBjaGVjaz0iYWx3YXlzIi8+DQo8L2pubHA+DQo=' |
||||
}, |
||||
{ |
||||
javafx : '8.0+' |
||||
}, |
||||
{} |
||||
); |
||||
} |
||||
<!-- Embed FX application into web page once page is loaded --> |
||||
dtjava.addOnloadCallback(javafxEmbedpropetiesfx); |
||||
</script> |
||||
|
||||
</head><body> |
||||
<h2>Test page for <b>PropetiesFx</b></h2> |
||||
<b>Webstart:</b> <a href='PropetiesFx.jnlp' onclick="return launchApplication('PropetiesFx.jnlp');">click to launch this app as webstart</a><br><hr><br> |
||||
|
||||
<!-- Applet will be inserted here --> |
||||
<div id='javafx-app-placeholder'></div> |
||||
</body></html> |
@ -0,0 +1,18 @@
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<jnlp spec="1.0" xmlns:jfx="http://javafx.com" href="PropetiesFx.jnlp"> |
||||
<information> |
||||
<title>PropetiesFx</title> |
||||
<vendor>denis</vendor> |
||||
<description>null</description> |
||||
<offline-allowed/> |
||||
</information> |
||||
<resources> |
||||
<j2se version="1.6+" href="http://java.sun.com/products/autodl/j2se"/> |
||||
<jar href="PropetiesFx.jar" size="3621" download="eager" /> |
||||
</resources> |
||||
<applet-desc width="800" height="600" main-class="com.javafx.main.NoJavaFXFallback" name="PropetiesFx" > |
||||
<param name="requiredFXVersion" value="8.0+"/> |
||||
</applet-desc> |
||||
<jfx:javafx-desc width="800" height="600" main-class="propetiesfx.PropetiesFx" name="PropetiesFx" /> |
||||
<update check="always"/> |
||||
</jnlp> |
After Width: | Height: | Size: 725 B |
After Width: | Height: | Size: 9.7 KiB |
After Width: | Height: | Size: 11 KiB |
After Width: | Height: | Size: 11 KiB |
After Width: | Height: | Size: 18 KiB |
After Width: | Height: | Size: 2.4 KiB |
After Width: | Height: | Size: 11 KiB |
After Width: | Height: | Size: 13 KiB |
@ -0,0 +1,3 @@
@@ -0,0 +1,3 @@
|
||||
Manifest-Version: 1.0 |
||||
X-COMMENT: Main-Class will be added automatically by build |
||||
|
@ -0,0 +1,2 @@
@@ -0,0 +1,2 @@
|
||||
# Do not modify this property in this configuration. It can be re-generated. |
||||
$label=\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043a\u0430\u043a WebStart |
@ -0,0 +1,2 @@
@@ -0,0 +1,2 @@
|
||||
# Do not modify this property in this configuration. It can be re-generated. |
||||
$label=\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 |
@ -0,0 +1,8 @@
@@ -0,0 +1,8 @@
|
||||
build.xml.data.CRC32=ddbd940c |
||||
build.xml.script.CRC32=7fe08f8b |
||||
build.xml.stylesheet.CRC32=8064a381@1.80.1.48 |
||||
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. |
||||
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. |
||||
nbproject/build-impl.xml.data.CRC32=ddbd940c |
||||
nbproject/build-impl.xml.script.CRC32=38974cbd |
||||
nbproject/build-impl.xml.stylesheet.CRC32=830a3534@1.80.1.48 |
@ -0,0 +1,2 @@
@@ -0,0 +1,2 @@
|
||||
# Do not modify this property in this configuration. It can be re-generated. |
||||
javafx.run.as=webstart |
@ -0,0 +1,2 @@
@@ -0,0 +1,2 @@
|
||||
# Do not modify this property in this configuration. It can be re-generated. |
||||
javafx.run.as=embedded |
@ -0,0 +1,4 @@
@@ -0,0 +1,4 @@
|
||||
auxiliary.org-netbeans-modules-projectapi.issue214819_5f_fx_5f_enabled=true |
||||
# \u041d\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0432 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u044d\u0442\u043e\u0433\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0434\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0437\u0430\u0434\u0430\u0447\u0438 JavaFX Ant |
||||
endorsed.javafx.ant.classpath=. |
||||
user.properties.file=C:\\Users\\denis.LAPTOP-4LI8UQ4O\\AppData\\Roaming\\NetBeans\\8.2\\build.properties |
@ -0,0 +1,9 @@
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<project-private xmlns="http://www.netbeans.org/ns/project-private/1"> |
||||
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/> |
||||
<open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2"> |
||||
<group> |
||||
<file>file:/C:/Users/denis.LAPTOP-4LI8UQ4O/OneDrive/Документы/NetBeansProjects/PropetiesFx/src/propetiesfx/PropetiesFx.java</file> |
||||
</group> |
||||
</open-files> |
||||
</project-private> |
@ -0,0 +1,113 @@
@@ -0,0 +1,113 @@
|
||||
annotation.processing.enabled=true |
||||
annotation.processing.enabled.in.editor=false |
||||
annotation.processing.processor.options= |
||||
annotation.processing.processors.list= |
||||
annotation.processing.run.all.processors=true |
||||
annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output |
||||
application.title=PropetiesFx |
||||
application.vendor=denis |
||||
build.classes.dir=${build.dir}/classes |
||||
build.classes.excludes=**/*.java,**/*.form |
||||
# This directory is removed when the project is cleaned: |
||||
build.dir=build |
||||
build.generated.dir=${build.dir}/generated |
||||
build.generated.sources.dir=${build.dir}/generated-sources |
||||
# Only compile against the classpath explicitly listed here: |
||||
build.sysclasspath=ignore |
||||
build.test.classes.dir=${build.dir}/test/classes |
||||
build.test.results.dir=${build.dir}/test/results |
||||
compile.on.save=true |
||||
compile.on.save.unsupported.javafx=true |
||||
# Uncomment to specify the preferred debugger connection transport: |
||||
#debug.transport=dt_socket |
||||
debug.classpath=\ |
||||
${run.classpath} |
||||
debug.test.classpath=\ |
||||
${run.test.classpath} |
||||
# This directory is removed when the project is cleaned: |
||||
dist.dir=dist |
||||
dist.jar=${dist.dir}/PropetiesFx.jar |
||||
dist.javadoc.dir=${dist.dir}/javadoc |
||||
endorsed.classpath= |
||||
excludes= |
||||
includes=** |
||||
# Non-JavaFX jar file creation is deactivated in JavaFX 2.0+ projects |
||||
jar.archive.disabled=true |
||||
jar.compress=false |
||||
javac.classpath=\ |
||||
${javafx.classpath.extension} |
||||
# Space-separated list of extra javac options |
||||
javac.compilerargs= |
||||
javac.deprecation=false |
||||
javac.processorpath=\ |
||||
${javac.classpath} |
||||
javac.source=1.8 |
||||
javac.target=1.8 |
||||
javac.test.classpath=\ |
||||
${javac.classpath}:\ |
||||
${build.classes.dir} |
||||
javac.test.processorpath=\ |
||||
${javac.test.classpath} |
||||
javadoc.additionalparam= |
||||
javadoc.author=false |
||||
javadoc.encoding=${source.encoding} |
||||
javadoc.noindex=false |
||||
javadoc.nonavbar=false |
||||
javadoc.notree=false |
||||
javadoc.private=false |
||||
javadoc.splitindex=true |
||||
javadoc.use=true |
||||
javadoc.version=false |
||||
javadoc.windowtitle= |
||||
javafx.application.implementation.version=1.0 |
||||
javafx.binarycss=false |
||||
javafx.classpath.extension=\ |
||||
${java.home}/lib/javaws.jar:\ |
||||
${java.home}/lib/deploy.jar:\ |
||||
${java.home}/lib/plugin.jar |
||||
javafx.deploy.allowoffline=true |
||||
# If true, application update mode is set to 'background', if false, update mode is set to 'eager' |
||||
javafx.deploy.backgroundupdate=false |
||||
javafx.deploy.embedJNLP=true |
||||
javafx.deploy.includeDT=true |
||||
# \u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 'true' \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u043e\u0442\u0432\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043a\u043e\u043f\u0438\u0438 \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u0430\u0440\u0442\u0435\u0444\u0430\u043a\u0442\u043e\u0432 \u0434\u043e \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430 (\u043e\u0442\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0438) |
||||
javafx.disable.concurrent.runs=false |
||||
# \u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 'true' \u0434\u043b\u044f \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0445 \u0437\u0430\u043f\u0443\u0441\u043a\u043e\u0432 \u043e\u0434\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 Run-in-Browser \u0438\u043b\u0438 WebStart |
||||
javafx.enable.concurrent.external.runs=false |
||||
# This is a JavaFX project |
||||
javafx.enabled=true |
||||
javafx.fallback.class=com.javafx.main.NoJavaFXFallback |
||||
# Main class for JavaFX |
||||
javafx.main.class=propetiesfx.PropetiesFx |
||||
javafx.preloader.class= |
||||
# This project does not use Preloader |
||||
javafx.preloader.enabled=false |
||||
javafx.preloader.jar.filename= |
||||
javafx.preloader.jar.path= |
||||
javafx.preloader.project.path= |
||||
javafx.preloader.type=none |
||||
# Set true for GlassFish only. Rebases manifest classpaths of JARs in lib dir. Not usable with signed JARs. |
||||
javafx.rebase.libs=false |
||||
javafx.run.height=600 |
||||
javafx.run.width=800 |
||||
# Pre-JavaFX 2.0 WebStart is deactivated in JavaFX 2.0+ projects |
||||
jnlp.enabled=false |
||||
# Main class for Java launcher |
||||
main.class=com.javafx.main.Main |
||||
# \u0414\u043b\u044f \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u044f \u043f\u043e\u0432\u044b\u0448\u0435\u043d\u043d\u043e\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u0442\u043e\u0447\u043d\u0435\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442\u0430 Codebase \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u043e\u0442\u0432\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f RIA |
||||
manifest.custom.codebase=* |
||||
# \u0423\u043a\u0430\u0436\u0438\u0442\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442\u0430 Permissions \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e (\u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b: sandbox, all-permissions) |
||||
manifest.custom.permissions= |
||||
manifest.file=manifest.mf |
||||
meta.inf.dir=${src.dir}/META-INF |
||||
platform.active=default_platform |
||||
run.classpath=\ |
||||
${dist.jar}:\ |
||||
${javac.classpath}:\ |
||||
${build.classes.dir} |
||||
run.test.classpath=\ |
||||
${javac.test.classpath}:\ |
||||
${build.test.classes.dir} |
||||
source.encoding=UTF-8 |
||||
src.dir=src |
||||
test.src.dir=test |
@ -0,0 +1,25 @@
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<project xmlns="http://www.netbeans.org/ns/project/1"> |
||||
<type>org.netbeans.modules.java.j2seproject</type> |
||||
<configuration> |
||||
<buildExtensions xmlns="http://www.netbeans.org/ns/ant-build-extender/1"> |
||||
<extension file="jfx-impl.xml" id="jfx3"> |
||||
<dependency dependsOn="-jfx-copylibs" target="-post-jar"/> |
||||
<dependency dependsOn="-rebase-libs" target="-post-jar"/> |
||||
<dependency dependsOn="jfx-deployment" target="-post-jar"/> |
||||
<dependency dependsOn="jar" target="debug"/> |
||||
<dependency dependsOn="jar" target="profile"/> |
||||
<dependency dependsOn="jar" target="run"/> |
||||
</extension> |
||||
</buildExtensions> |
||||
<data xmlns="http://www.netbeans.org/ns/j2se-project/3"> |
||||
<name>PropetiesFx</name> |
||||
<source-roots> |
||||
<root id="src.dir"/> |
||||
</source-roots> |
||||
<test-roots> |
||||
<root id="test.src.dir"/> |
||||
</test-roots> |
||||
</data> |
||||
</configuration> |
||||
</project> |
@ -0,0 +1,4 @@
@@ -0,0 +1,4 @@
|
||||
#Fri Feb 10 21:22:42 MSK 2023 |
||||
db.password=wertjhgfsdfnjyy |
||||
db.user=admin |
||||
db.url=jdbc\:derby\://localhost\:1527/PersonsDB |
@ -0,0 +1,125 @@
@@ -0,0 +1,125 @@
|
||||
/* |
||||
* 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 propetiesfx; |
||||
|
||||
import java.io.File; |
||||
import java.io.FileReader; |
||||
import java.io.FileWriter; |
||||
import java.io.IOException; |
||||
import javafx.application.Application; |
||||
import javafx.geometry.Pos; |
||||
import javafx.scene.Scene; |
||||
import javafx.scene.control.Button; |
||||
import javafx.scene.control.Label; |
||||
import javafx.scene.control.TextField; |
||||
import javafx.scene.layout.ColumnConstraints; |
||||
import javafx.scene.layout.GridPane; |
||||
import javafx.stage.Stage; |
||||
import java.util.Properties; |
||||
import java.util.logging.Level; |
||||
import java.util.logging.Logger; |
||||
import javafx.scene.control.Alert; |
||||
|
||||
/** |
||||
* |
||||
* @author denis |
||||
*/ |
||||
public class PropetiesFx extends Application { |
||||
private Properties propeties; |
||||
private TextField dbUrlField; |
||||
private TextField dbUserField; |
||||
private TextField dbPasswordField; |
||||
|
||||
@Override |
||||
public void start(Stage primaryStage) { |
||||
propeties = new Properties(); |
||||
File propertyFile = new File("property.prop"); |
||||
try { |
||||
if(!propertyFile.exists()) propertyFile.createNewFile(); |
||||
}catch(IOException e) {} |
||||
Label dbUrl = new Label("db.url="); |
||||
dbUrlField = new TextField(); |
||||
Label dbUser = new Label("db.user="); |
||||
dbUserField = new TextField(); |
||||
Label dbPassword = new Label("db.password="); |
||||
dbPasswordField = new TextField(); |
||||
Button read = new Button("Read"); |
||||
read.setOnAction(e -> getProperties(propertyFile)); |
||||
Button save = new Button("Save"); |
||||
save.setOnAction(e -> setProperties(propertyFile)); |
||||
|
||||
GridPane root = new GridPane(); |
||||
root.setAlignment(Pos.CENTER); |
||||
root.setGridLinesVisible(false); |
||||
root.getColumnConstraints().add(new ColumnConstraints(100)); |
||||
root.setHgap(5); |
||||
root.add(dbUrl, 0, 0, 1, 1); |
||||
root.add(dbUrlField, 1, 0, 3, 1); |
||||
|
||||
root.add(dbUser, 0, 1, 1, 1); |
||||
root.add(dbUserField, 1, 1, 3, 1); |
||||
|
||||
root.add(dbPassword, 0, 2, 1, 1); |
||||
root.add(dbPasswordField, 1, 2, 3, 1); |
||||
|
||||
root.add(read, 1, 3, 1, 1); |
||||
root.add(save, 3, 3, 1, 1); |
||||
|
||||
Scene scene = new Scene(root, 600, 500); |
||||
|
||||
primaryStage.setTitle("Properties"); |
||||
primaryStage.setScene(scene); |
||||
primaryStage.show(); |
||||
} |
||||
|
||||
/** |
||||
* @param args the command line arguments |
||||
*/ |
||||
public static void main(String[] args) { |
||||
launch(args); |
||||
} |
||||
|
||||
private void getProperties(File propertyFile){ |
||||
try { |
||||
propeties.load(new FileReader(propertyFile)); |
||||
dbUrlField.setText(propeties.getProperty("db.url")); |
||||
dbUserField.setText(propeties.getProperty("db.user")); |
||||
dbPasswordField.setText(propeties.getProperty("db.password")); |
||||
} catch (IOException ex) { |
||||
Logger.getLogger(PropetiesFx.class.getName()).log(Level.SEVERE, null, ex); |
||||
} |
||||
} |
||||
|
||||
private void setProperties(File propertyFile){ |
||||
String dbUrl = isValid(dbUrlField.getText()) ? dbUrlField.getText() : propeties.getProperty("db.url"); |
||||
String dbUser = isValid(dbUserField.getText()) ? dbUserField.getText() : propeties.getProperty("db.user"); |
||||
String dbPassword = isValid(dbPasswordField.getText()) ? dbPasswordField.getText() : propeties.getProperty("db.password"); |
||||
try { |
||||
propeties.setProperty("db.url", dbUrl); |
||||
propeties.setProperty("db.user", dbUser); |
||||
propeties.setProperty("db.password", dbPassword); |
||||
propeties.store(new FileWriter(propertyFile), null); |
||||
} catch (IOException ex) { |
||||
Logger.getLogger(PropetiesFx.class.getName()).log(Level.SEVERE, null, ex); |
||||
} |
||||
dbUrlField.setText(dbUrl); |
||||
dbUserField.setText(dbUser); |
||||
dbPasswordField.setText(dbPassword); |
||||
} |
||||
|
||||
private boolean isValid(String text){ |
||||
if(text==null || text.isEmpty()){ |
||||
Alert alert = new Alert(Alert.AlertType.WARNING); |
||||
alert.setTitle("isValid"); |
||||
alert.setHeaderText("Проверка значения ключа!"); |
||||
alert.setContentText("Значение ключа не соответствует правилам!"); |
||||
alert.showAndWait(); |
||||
return false; |
||||
} |
||||
return true; |
||||
} |
||||
|
||||
} |