Results 1 to 8 of 8

Thread: Building GUI

  1. #1
    alacn's Avatar
    alacn is offline Senior Member
    Join Date
    Jun 2010
    Location
    UK. near London
    Posts
    118
    Rep Power
    0

    Default Building GUI

    Just 2 quick question about building GUI.

    I've come across two methods of building a standard GUI, the first method is using the design mode that comes with netbeans and the other method is doing is purely by code.

    I've noticed that doing it by code seems to take longer, so im wondering what are the advantages (if any) doing it purely in code when i can simple cut time using a design interface?

    and my second question to the forum is, in a commerical application, do java programmers usually build their GUI's purely from code or using a designer?

    im worried that i may come across a GUI that is made purely from code and i wont be able to modify the information using a designer, forcing me to do it in code also.

    please advice me on which is best to concentrate my learning on.

    thank you !!

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,331
    Rep Power
    25

    Default

    You'll be better prepared if you understand how GUI works. Lots of students get lost as soon as they move away from their IDE because it does so much. They have no idea of how things work.

  3. #3
    Webuser is offline Senior Member
    Join Date
    Dec 2008
    Posts
    526
    Rep Power
    0

    Lightbulb

    Quote Originally Posted by Norm View Post
    You'll be better prepared if you understand how GUI works. Lots of students get lost as soon as they move away from their IDE because it does so much. They have no idea of how things work.
    Norm is right :)

    IDE is much helpful but it is not an down point for Swing developer...
    You have to study writing code manually. There are many interesting code tricks which do help to make any visual effect you want.
    for example if you want not to create many typical components manually (a buttoned table or so) you can use a loop for this

    Java Code:
    JButton b;
    JPanel p=new JPanel(new GridLayout(4,4));
    for(int i=0; i<16; i++)
    {
    b=new JButton(String.valueOf(i));
    p.add(b);
    
    }
    and so on... Just combine Swing with common Java things and all goes right ;)
    If my answer helped you. Please click my "REP" button and add a comment
    Have a Good Java Coding :)

  4. #4
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

    Default

    Quote Originally Posted by alacn View Post
    I've come across two methods of building a standard GUI, the first method is using the design mode that comes with netbeans and the other method is doing is purely by code.
    In first way you don't know what happen in backend. IDE do all the stuff for you. More than half of your code is auto generated.

    Quote Originally Posted by alacn View Post
    I've noticed that doing it by code seems to take longer, so im wondering what are the advantages (if any) doing it purely in code when i can simple cut time using a design interface?
    Advantage is that you can learn what's really going on. For an example if you want to add a button to close a form, then you've to learn how to initialize, how to attach listener and more.

    Quote Originally Posted by alacn View Post
    and my second question to the forum is, in a commerical application, do java programmers usually build their GUI's purely from code or using a designer?
    In industrial applications most of the times we start from the coding, not with an IDE. So we have more control over the application development. Actually that's happen with the experience.

    Quote Originally Posted by alacn View Post
    im worried that i may come across a GUI that is made purely from code and i wont be able to modify the information using a designer, forcing me to do it in code also.
    Modification to the code from the IDE is bit of hard work. For example write a simple UI code on notepad and open it in NetBeans. You cannot see the UI components on the designer directly. Because in NetBeans all the metadata stored in a *.form file. If you could write it manually then you can render the example in NetBeans properly. But the other way is easy.

  5. #5
    alacn's Avatar
    alacn is offline Senior Member
    Join Date
    Jun 2010
    Location
    UK. near London
    Posts
    118
    Rep Power
    0

    Default

    thanks for the replies, i will take your advice everyone.

  6. #6
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

  7. #7
    alacn's Avatar
    alacn is offline Senior Member
    Join Date
    Jun 2010
    Location
    UK. near London
    Posts
    118
    Rep Power
    0

    Default

    yeah i've been doing it from code anyhow, i just didnt know if i was wasting my time or not :)

  8. #8
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

Similar Threads

  1. Building DOM from XML with custom DTD
    By Optimango in forum Advanced Java
    Replies: 0
    Last Post: 05-05-2010, 12:42 PM
  2. Requirements for building a SSL VPN
    By adityag in forum New To Java
    Replies: 0
    Last Post: 01-19-2010, 04:46 PM
  3. Building to a .jar in Netbeans 6.7.1
    By Gregadeaux in forum New To Java
    Replies: 0
    Last Post: 12-14-2009, 03:00 AM
  4. JAR Building Problem
    By GhosT in forum New To Java
    Replies: 12
    Last Post: 09-27-2008, 03:21 PM
  5. building a house
    By dc2acgsr99 in forum Java Applets
    Replies: 4
    Last Post: 03-07-2008, 11:18 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •