A simple Java Swing text editor (Notepad-like) with:
- Open / Save / Print
- Word wrap
- Light/Dark theme (FlatLaf)
- Font family + font size controls
- Text color picker
- A Compile & Run button to compile/run a saved
.javafile (Windows)
- Windows (the in-app Compile & Run button uses a temporary
.batscript) - JDK installed (so
javaandjavacare available) - The dependency jar is already included in this repo:
external_jars/flatlaf-3.1.jar
Double-click:
BatchFile.batThis builds to out/ and launches the app.
From the project root:
cd "g:\Notepad-Java-Compiler"
if (Test-Path out) { Remove-Item -Recurse -Force out }
New-Item -ItemType Directory -Path out | Out-Null
javac -cp "external_jars/*" -d out src\*.java src\fonts\*.java
java -cp "out;external_jars/*" Maincd /d g:\Notepad-Java-Compiler
rmdir /s /q out
mkdir out
javac -cp "external_jars/*" -d out src\*.java src\fonts\*.java
java -cp "out;external_jars/*" Main- Type or paste Java code into the editor.
- Save the file with a
.javaextension. - Click Compile & Run.
Notes:
- Your system must have
javacon PATH. - It runs the compiled class from the same folder where you saved the file.
javacis not recognized: install a JDK and ensureJAVA_HOME/PATH is set.ClassNotFoundExceptionfor FlatLaf classes: make sure you run with the classpath includingexternal_jars/*.- Icons/fonts not showing: run commands from the project root (paths like
src/s.pngandsrc/fonts/JetBrainsMono.ttfare file-based).
- No Maven/Gradle build is used here; it’s a plain
javac/javaproject. - If you want a distributable
.jar, you’ll likely want to refactor file-based assets (icons/fonts) into classpath resources first.