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.
Basically this opens a 500x500 window titled "Hello CodeCall"Code: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); } }
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)
Last edited by Khaotic; 07-13-2010 at 12:55 PM.
Check out my site: www.khaoticirc.net
Thanks for this, helped me out!![]()
Thanks! Keep Posting!
Nice one. what if i want to write A GUI password programme?
Java has an awesome tutorial to mask input and things: Password Masking in the Java Programming Language
Be sure to read the updated FAQ || Health is achieved through 10,000 different steps.
A textual description can be only part of your question, be sure to provide sample results, errors and your platform in the appropriate forums while asking.
Thank you
Hi Nullw0rm but the code is not running on BlueJ
Last edited by Alexander; 12-03-2010 at 06:41 PM. Reason: Merged three posts
It uses AWT/Swing, so you may need to edit it a bit to get it to work. There are other password input tutorials on the web too if you search which are quite nice. Try not to create so many posts in one place!
Be sure to read the updated FAQ || Health is achieved through 10,000 different steps.
A textual description can be only part of your question, be sure to provide sample results, errors and your platform in the appropriate forums while asking.
okay . thank you
You dont need these imports:
The code can run on Swing by itself.Code:import java.awt.*; import java.awt.event.*;
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks