Code Monkey home page Code Monkey logo

javafx-custom-file-ext-boilerplate's Introduction

Boilerplate recognising .pew files.

JavaFX Custom File Extension Viewer boilerplate

This is a boilerplate for creating a JavaFX application that is capable of handling a custom file extension. There are some nuances/caveats to getting this right (especially on MacOS), which are described in the accompanying blog post. In this example, the application is set up to handle .pew files with the bundle identifier com.example.pew. The Makefile will generate app bundles that simply print out the opened file path:

Boilerplate recognising .pew files.

An example macOS bundle (.dmg) built using Github Actions is available here to check out.

Requirements

  • OpenJFX 21
  • OpenJDK 20,21
  • Gradle 8.4

Features

  • Associates a custom file type (.pew) with this application.
  • Uses the jpackage tool from open jdk 21 to create application bundles.
  • Capable of catching native apple FILE_OPEN events when double-clicking files.
  • Contains separate icons for file type and application.

Caveats

  • In order to catch all macOS FILE_OPEN events, the Launcher class needed to be introduced. While it allows to catch initial events, using it and launching JavaFX over the Main method means that AWT is the main GUI toolkit. The native system menu bar on mac os is no longer supported as a consequence.
  • Mime-type is set to binary files. Change *.properties configurations to your needs.
  • Windows platform not tested, yet. MacOS and Linux (Debian) are.

Usage

# run:
make -B

# bundle mac app:
make -B jpackage_darwin

# bundle linux app:
make -B jpackage_linux

javafx-custom-file-ext-boilerplate's People

Contributors

eschmar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.