DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
11 Monitoring and Observability Tools for 2023
Learn more
  1. DZone
  2. Coding
  3. Java
  4. Beautifying JavaFX Script From NetBeans Using AutoIt

Beautifying JavaFX Script From NetBeans Using AutoIt

James Sugrue user avatar by
James Sugrue
CORE ·
Nov. 30, 09 · Interview
Like (0)
Save
Tweet
Share
12.47K Views

Join the DZone community and get the full member experience.

Join For Free

netbeans is the official ide for javafx development. however, the latest v6.71 (or beta 6.8) of netbeans is unable to beautify javafx script (jfxscript) code as the “format” option is not working (it just do nothing.  see bug acknowledgement ).

editors note: this content was submitted by geekycoder

the code beautifier is one of the most important tools for learning and using  javafx as most raw code copied from internet/ebook tends to be unformatted, making it hard to read and use. performing manual format is just too tedious. so until the next netbeans’s release, users have to resort to using painstakingly manual code formatting .

code beautifier turn this (the following jfxscript code is formatted in netbeans ! read on to see how it’s done.)

image

into this

image

introducing autoit script

image autoit script is a productive and powerful free windows automation utility with scripting capability using a simple easy-to-use basic variant language. now with autoit script, users no longer have to sweat the formatting stuff.


watch how autoit script perform its magic.

autoit script accomplishes it in just seconds.

how it works

the javascript code beautifier in netbeans is surprisingly able to format the jfxscript code extremely well.  therefore, autoit script leverages on this “discovered” capability to automate the formatting by copying the jfxscript code to a opened javascript file for beautifying, and then replace original code. this is all done through keystroke simulation, and takes just few seconds. with netbeans’s undo feature, you can also undo the formatting instantly.

instructions

the following download includes the source code, dummy file and 32bit executable compiled script. if you need to run in 64bit, you need to download the autoit environment to either recompile the source or run the source with autoit interpreter.

please perform the important steps before using the script.

important #1:
you need to keymap the <open file> menu item to <ctrl+f10> keys.

go to:

tools –> options –> keymap image

important #2:
create a empty file called dummy.js or copy one from the following zip file  into <c:\temp> dir. this dummy file is used as a proxy to format code.

you can customize the keymap keys and dummy file through the script source from the following lines:

local $keybeautify = "^{f2}" ; default to ctnl + f2
local $keyopenfile = "^{f10}" ; open file, default to ctnl + f10
local $dummyjsfile = "c:\temp\dummy.js" ; dummy js file

if you experience some problems making it work, play around with the delay. increase the delay in the sleep function (eg sleep(330) ). the argument is in millisec.

unzip the following file and run < netbeans_beautify_jfxscript.exe >

the autoit trayicon (blue a icon) will appear. now you can go to netbeans source code editor and invoke <ctnl+f2> to format the jfxscript code !

to exit, click on the icon again and choose exit.

image image

contents of file:

image

code_beautifier.zip (272kb)

JavaFX Script NetBeans JavaFX

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • 7 Most Sought-After Front-End Frameworks for Web Developers
  • Build an Automated Testing Pipeline With GitLab CI/CD and Selenium Grid
  • Reliability Is Slowing You Down
  • gRPC on the Client Side

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: