Results 1 to 12 of 12
Like Tree3Likes
  • 2 Post By Fubarable
  • 1 Post By Junky

Thread: java GUI

  1. #1
    tnrh1 is offline Senior Member
    Join Date
    Aug 2011
    Posts
    251
    Rep Power
    4

    Default java GUI

    Hello everyone,
    I'm a java programmer for 2 years already.
    Few days ago I've started to work with some graphical user infertaces.
    I've seen some guides and people using a visual GUI maker.
    If someone could refer me to a link I would appreciate it.

    Thanks in advanced.

  2. #2
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Location
    Dystopia
    Posts
    3,798
    Rep Power
    7

    Default

    Some IDE's have built in or plug-in GUI builders. However I stongly urge you to read some tutorials and write the code yourself. GUI builders can produce some ugly code. Plus if you write the code yourself then you will understand it.

  3. #3
    tnrh1 is offline Senior Member
    Join Date
    Aug 2011
    Posts
    251
    Rep Power
    4

    Default

    Quote Originally Posted by Junky View Post
    Some IDE's have built in or plug-in GUI builders.
    Yea, that I already know .. the reason I open this thread is that I couldn't find a working link and also guidelines how to install the plugin.

    Quote Originally Posted by Junky View Post
    However I stongly urge you to read some tutorials and write the code yourself. GUI builders can produce some ugly code. Plus if you write the code yourself then you will understand it.
    It's true, but I will learn much faster with the visual GUI.
    Right now I know several GUI objects, and if I want to change it I have to look for guides.
    Using the Visual GUI will help me to expand my knowledge, since I can add a new button and the look at the source code.

  4. #4
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    Quote Originally Posted by tnrh1 View Post
    It's true, but I will learn much faster with the visual GUI.
    Quite the opposite. You will learn how to drag and drop rectangles but will gain no understanding of what is happening underneath, and will not have pretty code to study. Many believe that use of drag-and-drop code generation can slow the Java learning process, a lot.


    Using the Visual GUI will help me to expand my knowledge, since I can add a new button and the look at the source code.
    Again, if you think that you can learn from the source code that the utility produces, you are sadly misguided and will be sorely disappointed. It's just not going to happen.
    camickr and DarrylBurke like this.

  5. #5
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Location
    Dystopia
    Posts
    3,798
    Rep Power
    7

    Default

    Java Code:
    layout.setHorizontalGroup(
                layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                .add(layout.createSequentialGroup()
                    .addContainerGap()
                    .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                        .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
                            .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                                .add(DPWL)
                                .add(PPHL)
                                .add(HPDL))
                            .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                            .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false)
                                .add(org.jdesktop.layout.GroupLayout.LEADING, PPH, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 101, Short.MAX_VALUE)
                                .add(HPD)
                                .add(org.jdesktop.layout.GroupLayout.LEADING, DPW))
                            .add(54, 54, 54)
                            .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                                .add(PPD)
                                .add(PPW)
                                .add(PPY))
                            .add(78, 78, 78))
                        .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
                            .add(jButton1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 230, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .add(145, 145, 145))
                        .add(layout.createSequentialGroup()
                            .add(TITLE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 502, Short.MAX_VALUE)
                            .addContainerGap())))
            );
    I am reasonably experienced in writing Swing code but the above scares the cr@p outta me.
    DarrylBurke likes this.

  6. #6
    tnrh1 is offline Senior Member
    Join Date
    Aug 2011
    Posts
    251
    Rep Power
    4

    Default

    Let's go your way, you have any GUI tutorial to recommend for me?
    I found few that explains about the JOptionPane.
    This class is the only one I know to use in the "GUI world" atm xD

  7. #7
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Location
    Dystopia
    Posts
    3,798
    Rep Power
    7

    Default

    Google "The Really Big Index" and scroll down to Graphical User Interface. You can also go to the Java API and look at the classes in the Swing package (generally classes that start with 'J' eg JFrame, JPanel etc). Most of those classes will have a link to "how to use..."

  8. #8
    anthropamorphic's Avatar
    anthropamorphic is offline Senior Member
    Join Date
    Jun 2011
    Posts
    135
    Rep Power
    0

    Default

    Quote Originally Posted by Junky View Post
    Some IDE's have built in or plug-in GUI builders. However I stongly urge you to read some tutorials and write the code yourself. GUI builders can produce some ugly code. Plus if you write the code yourself then you will understand it.
    I agree with you, but it can be a little difficult sometimes to get everything were you want it just by code.

  9. #9
    j2me64's Avatar
    j2me64 is offline Senior Member
    Join Date
    Sep 2009
    Location
    Zurich, Switzerland
    Posts
    962
    Rep Power
    6

    Default

    Quote Originally Posted by tnrh1 View Post
    If someone could refer me to a link I would appreciate it.
    start here: Trail: Creating a GUI With JFC/Swing (The Java™ Tutorials)
    Last edited by j2me64; 08-16-2011 at 11:34 PM.

  10. #10
    stchman's Avatar
    stchman is offline Member
    Join Date
    Apr 2011
    Location
    Saint Louis, Missouri
    Posts
    97
    Rep Power
    0

    Default

    Netbeans has a really good GUI builder for Java, but I do recommend that you write a few GUIs by hand.

    You will learn a lot more about what goes on to make a GUI and you will appreciate what the GUI builder does.

    I only recommend IDEs for more experienced users, anyone just learning the language get a good Java programmers text editor(Notepad++, Geany, etc.), open a terminal, and start programming.
    If you aren't programming in Java, well that's just too bad.
    I'd rather be using Ubuntu.

  11. #11
    anthropamorphic's Avatar
    anthropamorphic is offline Senior Member
    Join Date
    Jun 2011
    Posts
    135
    Rep Power
    0

    Default

    Quote Originally Posted by stchman View Post
    Netbeans has a really good GUI builder for Java, but I do recommend that you write a few GUIs by hand.

    You will learn a lot more about what goes on to make a GUI and you will appreciate what the GUI builder does.

    I only recommend IDEs for more experienced users, anyone just learning the language get a good Java programmers text editor(Notepad++, Geany, etc.), open a terminal, and start programming.
    Why would you even try to write in a text editor? It would just be a terrible useless process. Since you will always have an IDE why not use it? The problem I had when trying to right in text edit (mac version of notepad) is I would sometimes mess up spacing a bit and it would just completely ruin my project.

  12. #12
    tnrh1 is offline Senior Member
    Join Date
    Aug 2011
    Posts
    251
    Rep Power
    4

    Default

    Quote Originally Posted by j2me64 View Post
    Thanks.


    but it can be a little difficult sometimes to get everything were you want it just by code.
    Exactly.

    Last 2 days I was studying like a freak, I feel improvement.

    Anyway I think would be better if I will have that builder, test it alittle bit and make my own disicions.
    So again, if anyone got a link for one that would help me alot.
    I already found few but my anti-virus warned me about a virus.

    Thanks in advanced.

    Btw I'm happy to be a party of this forum, looks like a very active one with alot of nice people.

Posting Permissions

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