Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 6 of 6

Thread: Questions in creating GUI

  1. #1
    Junior Member
    Join Date
    Dec 2013
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Questions in creating GUI

    Can I create forms in Java using notepad? The only way I know is to use Eclipse IDE and its called SWT. Is there any other import available specifically in Java and not in Eclipse?


  2. #2
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    6,285
    My Mood
    Mellow
    Thanks
    252
    Thanked 777 Times in 762 Posts

    Default Re: Questions in creating GUI

    Yes you can, using the the same code as used in Eclipse. There may be some growing pains to get your environment set up, so start small with simple tutorials and work up from there.

  3. #3
    Junior Member
    Join Date
    Dec 2013
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: Questions in creating GUI

    When I tried creating a form on Eclipse, the import was org.eclipse.swt.widgets.*. I don't know if that will work when hand coded. I researched on Google saying I need to use awt. Other sites says I need to use swing. I'm confused on what is the basics on creating a GUI.

  4. #4
    Member andbin's Avatar
    Join Date
    Dec 2013
    Location
    Italy
    Posts
    443
    Thanks
    4
    Thanked 122 Times in 114 Posts

    Default Re: Questions in creating GUI

    Quote Originally Posted by markandrewkato View Post
    When I tried creating a form on Eclipse, the import was org.eclipse.swt.widgets.*. I don't know if that will work when hand coded. I researched on Google saying I need to use awt. Other sites says I need to use swing. I'm confused on what is the basics on creating a GUI.
    AWT was the first GUI framework bundled with the Java SE (Standard Edition) framework. AWT is very limited and actually not much used. Swing was the second GUI framework introduced in Java SE and it's more sophisticated, more components, look&feels support, easy customizations, etc...
    SWT is not part of Java SE. SWT comes from the Eclipse Foundation. It uses a native library to access the native GUI libraries of the operating system.

    Since you would like to start with GUI development: start with Swing.
    The Oracle official tutorial is: Trail: Creating a GUI With JFC/Swing
    Andrea, www.andbin.net SCJP 5 (91%) SCWCD 5 (94%)

    Useful links for Java beginners My new project Java Examples on Google Code

  5. #5
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    6,285
    My Mood
    Mellow
    Thanks
    252
    Thanked 777 Times in 762 Posts

    Default Re: Questions in creating GUI

    You asked if you could use SWT using Notepad. The answer is, "Yes, you can." As I suggested, you should find a basic SWT tutorial that includes instructions on how to get your environment set up correctly. What the tutorial should tell you is to download swt.jar and add that to your jar files on the CLASSPATH.

    If your question is really whether you should use AWT, SWT, or Swing (or JavaFX) to create GUI applications in Java, then the answer to that that is a personal choice just as using Notepad or Netbeans instead of Eclipse is a personal choice. Try all 3 toolkits and see which you prefer, but don't expect or even allow someone or Google to make the personal choice for you.

  6. #6
    Junior Member
    Join Date
    Dec 2013
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: Questions in creating GUI

    @andbin Thank you very much! It was a very neat explanation. Now I understand the difference and uses of these three. I'll try your suggestion in starting out with swing.

    @GregBrannon Sorry my question is very misleading. Now I know its a personal choice which to use with these three. I'll also try these three after I'm done studying with the swing framework so I'll get an idea on which is the best to use. Thanks!

Similar Threads

  1. Problem when creating login gui
    By RandomGaisha in forum What's Wrong With My Code?
    Replies: 3
    Last Post: November 24th, 2012, 09:16 AM
  2. Can anyone help me finish creating a GUI for my program
    By danbendlin in forum What's Wrong With My Code?
    Replies: 4
    Last Post: March 16th, 2012, 08:34 PM
  3. 2 questions about GUI and one for my curiousity(multi thread)
    By derekxec in forum Java Theory & Questions
    Replies: 2
    Last Post: June 29th, 2011, 06:31 PM
  4. creating GUI using java, need help?
    By koko20 in forum What's Wrong With My Code?
    Replies: 3
    Last Post: April 5th, 2011, 03:51 PM
  5. creating a gui
    By rsala004 in forum AWT / Java Swing
    Replies: 2
    Last Post: July 21st, 2009, 03:17 AM

Tags for this Thread