This Editer π is created with the help of java β. It presents the use of simple java IO β to make some creative Apps. Basic understanding of java and javafx is enough to customize π this accourding to your needs.
- JDK 9 β or any JDK with openfx lib (Some changes in import code section is needed in order to use openfx)
- Php
- Handle multiple π’ tab at a time
- Very lightweight π
- Uses simple java IO β
./Editer.css
./PHPServer.java
./phpe2.png
...
Ignore any extra files in source code. Let's take a look att code.
Editer.css
- This defines css π¨ for application. Javafx supports css integration in code this provides javafx an edge over other GUI tool such asSwing
orAWT
.PHPServer.java
- This is main class to handle all action from taking input to rendering output and showing to the user.phpe2.png
- It's only logo for application .
So how all this works ? So answer is very simple, just using java IO β. There are mainly two componets in GUI of application.
- TextArea GUI components
- WebView GUI components
When user type Php code π¨βπ» into TextArea the corresponding result is shown in the WebView components. Let's take a look at the process behind the the seen.
- The code written by the user is fetched by the application and written to a temporary php file π after every keystroke.
- The generated temporary php fileπ then executedβ by the php program to generate equaivalent html code which is saved to another temporary html fileπ.
- The generated temporary Html response file π by php code is loaded into WebView.
- That's all π―.
Note:- If the local file π is opend instead of creating new file then at the end when user press Ctrl+S
or choose save from menu
the current state of file in saved to opened local file. As it should be.
Just run βΆ the PHPServer.java as normal java program and You will be all set to use this lightweight app.
javac PHPServer.java
java PHPServer
- Syntax highlighting
- Links π opening behaivour, Mainly for
target="_blank"