Last active
September 3, 2021 12:24
-
-
Save zwazel/f6830cf5bcc35e1ec7931130ea8f9590 to your computer and use it in GitHub Desktop.
File Templates for IntelliJ
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "") package ${PACKAGE_NAME};#end | |
#parse("File Header.java") | |
import javafx.application.Application; | |
import javafx.scene.Scene; | |
import javafx.scene.layout.GridPane; | |
import javafx.stage.Stage; | |
public class ${NAME} extends Application { | |
public static void main(String[] args) { | |
launch(args); | |
} | |
@Override | |
public void start(Stage primaryStage) { | |
GridPane layout = new GridPane(); // Replace the Gridpane with whatever you want | |
Scene scene = new Scene(layout, 300, 250); | |
primaryStage.setScene(scene); | |
primaryStage.show(); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.onload = function () { | |
simulate(); | |
} | |
function simulate(canvasId = "canvas") { | |
let canvas = document.getElementById(canvasId), | |
context = canvas.getContext("2d"), | |
width = canvas.width = window.innerWidth, | |
height = canvas.height = window.innerHeight; | |
update(); | |
function update() { | |
context.clearRect(0, 0, width, height); | |
requestAnimationFrame(update); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end | |
#parse("File Header.java") | |
public class ${NAME} { | |
public ${NAME}() { | |
} | |
public static void main(String[] args) { | |
new ${NAME}(); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end | |
#parse("File Header.java") | |
import java.awt.*; | |
public class ${NAME} extends Canvas { | |
public ${NAME}() { | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end | |
#parse("File Header.java") | |
import javax.swing.*; | |
public class ${NAME} extends JDialog { | |
public ${NAME}(JFrame parent, String titel, boolean modal) { | |
super(parent, titel, modal); | |
initComponents(); | |
} | |
private void initComponents() { | |
setSize(500, 500); | |
setVisible(true); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end | |
#parse("File Header.java") | |
import javax.swing.*; | |
public class ${NAME} extends JFrame { | |
public ${NAME}() { | |
initComponents(); | |
} | |
private void initComponents() { | |
setSize(300,300); | |
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); | |
setTitle("${NAME}"); | |
setVisible(true); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end | |
#parse("File Header.java") | |
import javax.swing.*; | |
public class ${NAME} extends JWindow { | |
public ${NAME}() { | |
initComponents(); | |
} | |
private void initComponents() { | |
setSize(300,300); | |
setVisible(true); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end | |
#parse("File Header.java") | |
import javax.servlet.http.HttpServlet; | |
import javax.servlet.http.HttpServletRequest; | |
import javax.servlet.http.HttpServletResponse; | |
public class ${NAME} extends HttpServlet { | |
public void doGet(HttpServletRequest request, HttpServletResponse response) { | |
doGet(request, response); | |
} | |
public void doPost(HttpServletRequest request, HttpServletResponse response) { | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end | |
#parse("File Header.java") | |
public class ${NAME} { | |
public ${NAME}() { | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end | |
#parse("File Header.java") | |
#set($classNameCamelCase = $NAME.substring(0,1).toLowerCase() + $NAME.substring(1)) | |
public class ${NAME} implements Runnable { | |
private Thread ${classNameCamelCase}; | |
private final String threadName; | |
public ${NAME}(String threadName) { | |
this.threadName = threadName; | |
} | |
@Override | |
public void run() { | |
System.out.println("THREAD RUNNING " + threadName); | |
// Methods will be executed HERE | |
System.out.println("THREAD ENDED " + threadName); | |
} | |
public void start() { | |
System.out.println("THREAD STARTED " + threadName); | |
if (${classNameCamelCase} == null) { | |
${classNameCamelCase} = new Thread(this, threadName); | |
${classNameCamelCase}.start(); | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end | |
#parse("File Header.java") | |
#set($classNameCamelCase = $NAME.substring(0,1).toLowerCase() + $NAME.substring(1)) | |
public class ${NAME} extends Thread { | |
private Thread ${classNameCamelCase}; | |
private final String threadName; | |
public ${NAME}(String threadName) { | |
this.threadName = threadName; | |
} | |
@Override | |
public void run() { | |
System.out.println("THREAD RUNNING " + threadName); | |
// Methods will be executed HERE | |
System.out.println("THREAD ENDED " + threadName); | |
} | |
public void start() { | |
System.out.println("THREAD STARTED " + threadName); | |
if (${classNameCamelCase} == null) { | |
${classNameCamelCase} = new Thread(this, threadName); | |
${classNameCamelCase}.start(); | |
} | |
} | |
} |
Muetzilla
commented
Feb 15, 2021
- Dankeschön!
- @zwazel
bidde @Muetzilla
THANKS @zwazel
Thänks @zwazel
jaja keis ding @Phillip-05 und @Loic190
THàNKAJS @zwazel
YOU SO GUD @zwazel
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment