JAVA Hello World - GUI

Well just so I get back into the groove of making tutorials, I am going to make a quick Hello World graphical user interface window. I'm not with my compiler right now and it has been a few weeks since I have worked on a GUI (currently working on an IRCd made in java with services written in tcl{i know lol}



Alright here we go.

import javax.swing.*; 

import java.awt.*;

import java.awt.event.*;

public class helloWorld extends JFrame {
helloWorld(String title) {
this.setSize(500,500);
setTitle(title);
}

public static void main(String[] args) {
helloWorld window = new helloWorld("Hello CodeCall");
window.setVisible(true);
window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
}

Basically this opens a 500x500 window titled "Hello CodeCall"

Please remember I did this without my compiler(yes, I know this is simple, but also consider I havent done a GUI in a matter of weeks, if not months) 

No comments:

Post a Comment