├── .gitignore ├── bin └── clean.sh ├── pom.xml ├── proguard.conf └── src └── main ├── deploy └── package │ ├── macosx │ └── javafx-and-proguard.icns │ └── windows │ └── javafx-and-proguard.ico ├── java └── javafx_and_proguard │ ├── HelloController.java │ └── MainApp.java └── resources ├── images └── background.jpg ├── javafx_and_proguard └── HelloController.fxml ├── log4j.xml └── styles └── styles.css /.gitignore: -------------------------------------------------------------------------------- 1 | # MAC OS Stuff 2 | .DS_Store 3 | 4 | # IDEA stuff 5 | .idea 6 | *.iml 7 | 8 | # Maven staff 9 | target/ 10 | -------------------------------------------------------------------------------- /bin/clean.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | mvn clean 4 | 5 | rm -rf .idea 6 | rm -f *.iml 7 | rm -f */*.iml 8 | rm -rf */target 9 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 4.0.0 5 | 6 | javafx-and-proguard 7 | javafx-and-proguard 8 | javafx-and-proguard 9 | 10 | jar 11 | 1.0-SNAPSHOT 12 | 13 | 14 | 15 | Acme 16 | 17 | 18 | 19 | 1.6.1 20 | 21 | 22 | 23 | 24 | javafx-and-proguard 25 | 26 | 27 | 28 | com.github.wvengen 29 | proguard-maven-plugin 30 | 2.0.9 31 | 32 | 33 | package 34 | 35 | proguard 36 | 37 | 38 | 39 | 40 | 5.2 41 | 42 | ${java.home}/lib/rt.jar 43 | ${java.home}/lib/ext/jfxrt.jar 44 | ${java.home}/lib/jce.jar 45 | 46 | 47 | 48 | 49 | net.sf.proguard 50 | proguard-base 51 | 5.2.1 52 | runtime 53 | 54 | 55 | 56 | 57 | 58 | com.zenjava 59 | javafx-maven-plugin 60 | 8.1.3-SNAPSHOT 61 | 62 | true 63 | 64 | javafx_and_proguard.MainApp 65 | 66 | 67 | example-user 68 | example-password 69 | true 70 | 71 | mac.app 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | com.miglayout 85 | miglayout-javafx 86 | 4.2 87 | 88 | 89 | 90 | 91 | 92 | commons-lang 93 | commons-lang 94 | 2.6 95 | 96 | 97 | 98 | 99 | 100 | org.slf4j 101 | slf4j-api 102 | ${slf4j.version} 103 | 104 | 105 | org.slf4j 106 | jcl-over-slf4j 107 | ${slf4j.version} 108 | 109 | 110 | org.slf4j 111 | slf4j-log4j12 112 | ${slf4j.version} 113 | 114 | 115 | log4j 116 | log4j 117 | 1.2.16 118 | 119 | 120 | 121 | 122 | 123 | -------------------------------------------------------------------------------- /proguard.conf: -------------------------------------------------------------------------------- 1 | -dontoptimize 2 | 3 | # Save meta-data for stack traces 4 | -renamesourcefileattribute SourceFile 5 | -keepattributes SourceFile,LineNumberTable 6 | 7 | # Rename FXML files together with related views 8 | -adaptresourcefilenames **.fxml,**.png,**.css 9 | -adaptresourcefilecontents **.fxml 10 | -adaptclassstrings 11 | 12 | # Keep all annotations and meta-data 13 | -keepattributes *Annotation*,Signature,EnclosingMethod 14 | 15 | # Keep entry-point class 16 | -keep class javafx_and_proguard.MainApp { 17 | public static void main(java.lang.String[]); 18 | } 19 | 20 | # Keep all classes inside application 21 | -keep,allowobfuscation class javafx_and_proguard.** { 22 | } 23 | 24 | # Keep names of fields marked with @FXML attribute 25 | -keepclassmembers class * { 26 | @javafx.fxml.FXML *; 27 | } 28 | -------------------------------------------------------------------------------- /src/main/deploy/package/macosx/javafx-and-proguard.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxd/javafx-and-proguard/481c3d5e292ec7cc583cd61a56bc15d430aae750/src/main/deploy/package/macosx/javafx-and-proguard.icns -------------------------------------------------------------------------------- /src/main/deploy/package/windows/javafx-and-proguard.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxd/javafx-and-proguard/481c3d5e292ec7cc583cd61a56bc15d430aae750/src/main/deploy/package/windows/javafx-and-proguard.ico -------------------------------------------------------------------------------- /src/main/java/javafx_and_proguard/HelloController.java: -------------------------------------------------------------------------------- 1 | package javafx_and_proguard; 2 | 3 | import javafx.fxml.FXML; 4 | import javafx.scene.control.Label; 5 | import javafx.scene.control.TextField; 6 | import org.apache.commons.lang.StringUtils; 7 | import org.slf4j.Logger; 8 | import org.slf4j.LoggerFactory; 9 | 10 | public class HelloController 11 | { 12 | @FXML private Label lblClassName; 13 | 14 | @FXML 15 | private void initialize() { 16 | lblClassName.setText(this.getClass().getCanonicalName()); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/javafx_and_proguard/MainApp.java: -------------------------------------------------------------------------------- 1 | package javafx_and_proguard; 2 | 3 | import javafx.application.Application; 4 | import javafx.fxml.FXMLLoader; 5 | import javafx.scene.Parent; 6 | import javafx.scene.Scene; 7 | import javafx.stage.Stage; 8 | import org.slf4j.Logger; 9 | import org.slf4j.LoggerFactory; 10 | 11 | public class MainApp extends Application { 12 | 13 | private static final Logger log = LoggerFactory.getLogger(MainApp.class); 14 | 15 | public static void main(String[] args) throws Exception { 16 | launch(args); 17 | } 18 | 19 | public void start(Stage stage) throws Exception { 20 | 21 | log.info("Starting Hello JavaFX and Maven demonstration application"); 22 | 23 | String fxmlFile = "/javafx_and_proguard/" + HelloController.class.getSimpleName() + ".fxml"; 24 | log.debug("Loading FXML for main view from: {}", fxmlFile); 25 | FXMLLoader loader = new FXMLLoader(); 26 | Parent rootNode = (Parent) loader.load(getClass().getResourceAsStream(fxmlFile)); 27 | 28 | log.debug("Showing JFX scene"); 29 | Scene scene = new Scene(rootNode, 400, 200); 30 | scene.getStylesheets().add("/styles/styles.css"); 31 | 32 | stage.setTitle("Hello JavaFX and Maven"); 33 | stage.setScene(scene); 34 | stage.show(); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/resources/images/background.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxd/javafx-and-proguard/481c3d5e292ec7cc583cd61a56bc15d430aae750/src/main/resources/images/background.jpg -------------------------------------------------------------------------------- /src/main/resources/javafx_and_proguard/HelloController.fxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 13 | 14 | -------------------------------------------------------------------------------- /src/main/resources/log4j.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/main/resources/styles/styles.css: -------------------------------------------------------------------------------- 1 | /* Application wide styles */ 2 | 3 | .label { 4 | -fx-font-size: 12px; 5 | -fx-font-weight: bold; 6 | -fx-text-fill: #333333; 7 | -fx-effect: dropshadow( gaussian , rgba(255,255,255,0.5) , 0,0,0,1 ); 8 | } 9 | 10 | .button { 11 | -fx-text-fill: white; 12 | -fx-font-family: "Arial Narrow"; 13 | -fx-font-weight: bold; 14 | -fx-background-color: linear-gradient(#61a2b1, #2A5058); 15 | -fx-effect: dropshadow( three-pass-box , rgba(0,0,0,0.6) , 5, 0.0 , 0 , 1 ); 16 | } 17 | 18 | .button:hover{ 19 | -fx-base: #395bae; 20 | } 21 | 22 | /* Component specific styles */ 23 | 24 | 25 | .main-panel { 26 | -fx-background-image: url("../images/background.jpg"); 27 | } 28 | 29 | .hello-message { 30 | -fx-text-fill: #AA0000; 31 | -fx-font-weight: bold; 32 | -fx-effect: dropshadow( gaussian , rgba(255,255,255,0.5) , 0,0,0,1 ); 33 | } 34 | 35 | --------------------------------------------------------------------------------