dlsc-software-consulting-gmbh / GemsFX

A collection of JavaFX controls and utilities.
Apache License 2.0
445 stars 52 forks source link

TimePicker and SceneBuilder #51

Closed kromar777 closed 4 months ago

kromar777 commented 2 years ago

Hello and thanks for great library!

Is it possible to use a TimePicker with SceneBuilder? I tried and SceneBuilder doesn't allow timepicker dragging on the form. It can be added by editing .fxml though and it works but again scene builder won't open .fxml with timepicker.

dlemmermann commented 2 years ago

I never tried that. I am not much of a SceneBuilder user. I write my FXML manually or use the Java API. Please google what the requirements are for adding a control to SceneBuilder.

cpreisler commented 1 year ago

Hello, I ran into this issue yesterday. To fix it, I built gemsFx using the maven-shade-plugin. I then added the fat jar that was created to SceneBuilder, and now I can drag and drop the TimePicker onto the form and open the fxml file after it is added.

SceneBuilder was silently crashing with a NoClassDefFoundError for org/kordamp/ikonli/javafx/FontIcon. I was able to figure that out by building scenebuilder locally and running it from the command line. SceneBuilder then produced a log file that gave enough info to find the problem.

Here is the shade plugin that was added to the gemsfx POM. The transformer is the key to making this work.

<plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.4.1</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <artifactSet>
                                <excludes>
                                    <exclude>org.openjfx:*</exclude>
                                </excludes>
                            </artifactSet>
                            <createDependencyReducedPom>false</createDependencyReducedPom>
                            <outputFile>target/gemsfx-${project.version}-all.jar</outputFile>
                            <transformers>
                                <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
                            </transformers>
                        </configuration>
                    </execution>
                </executions>
            </plugin>    
dlemmermann commented 1 year ago

can you submit a PR for this please?

dlemmermann commented 1 year ago

Then again .... isn't it possible to add a library to SceneBuilder via its group and artefact ID? Then it should pull in all dependencies, too, right?

dlemmermann commented 1 year ago

I just tried that and it did not work .... hmmmm

cpreisler commented 1 year ago

Yes I can. I'll get it done tomorrow. I tested again, and it did work for me. Did you get it to work?

On Fri, Mar 24, 2023 at 10:31 AM Dirk Lemmermann @.***> wrote:

can you submit a PR for this please?

— Reply to this email directly, view it on GitHub https://github.com/dlsc-software-consulting-gmbh/GemsFX/issues/51#issuecomment-1482999296, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADVDHDVDN2KE26ANP4BWC4LW5W43TANCNFSM5TTQWXJQ . You are receiving this because you commented.Message ID: @.***>

dlemmermann commented 1 year ago

yes I did