• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Designing GUIs

 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Howdy all, I'm a newbie .... why else would I be here.

However, just to give you some background: I've been programming in one form another for the past 30ish years .. scary .. the last 14 or so using Powerbuilder (PB) (javascript:%20x()... don't larf) and Oracle, developing client/server applications as a contractor. Now PB, bless it's cotton socks, is virtually dead in the UK and I need to find some other way to earn a crust. So I elected to xcross train into java - some would say a bit late in the day!

Now my question: I figured the best way to learn this stuff would be to grasp the basics (I'm nearly there) and then dive in and migrate a small bespoke PB app that I wrote for a local IFA. What's confusing me is that when I look at all the books and online tutorials for the GUI aspect of things I very much get the impression that the intention (at least originally) is to that it should be done textually.

Is that right?

Do java guys, in reality, really design GUIs textually as opposed to using an IDE?
[I should say I'm totally aware of the benefits of understanding the underlying code both from a learning angle and a development viewpoint. With PB there are times when it's far easier to go in and tweak things textually than fight the IDE]

One of the reasons I ask this is that, obviously, I'm trying to align my skills to maximize my chances of gaining new contracts whilst leveraging my experience. So, having determined that the main flavours of IDE seem to be Netbeans (which I'm using for some of my training) and Eclipse, I did some research (in the UK market) on JobServe. I found that Netbeans is very rarely a required skill and often AWT/SWING/GUI skills are mentioned with no reference to an IDE at all. This, coupled with the preponderance of tutorials and books to focus on the textual aspects of GUI development, led me to wonder if fully fledged java guys just used a textual approach. Hence the question.

Sorry if this seems a lame question but java's a big world and I'm having problems deciding where to concentrate my efforts.

I'm sure there will be more lame questions I'm afraid!

Regards and thanks for any insight you might give me,
Phil.
 
Bartender
Posts: 2856
10
Firefox Browser Fedora Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Phil Hopgood welcome to Javaranch,

Originally posted by Phil Hopgood
Howdy all, I'm a newbie .... why else would I be here



No its not true, the ranch does have lot of authors, Java architects, and many such Java gurus.


Do java guys, in reality, really design GUIs textually as opposed to using an IDE?



Not really, I think and as you said you are getting familiar with Netbeans, it does come with a palette for GUI design.


Hoep this helps .
 
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Amit Ghorpade:
Not really



Well, in fact, I do. I find that programming GUIs (in contrast to drag'n'dropping them) gives me more control and a lot of opportunities to remove duplication, which might be a bit more work to start with, but has a lot of advantages during maintenance.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Textually, a.k.a manually, for me too. Copy&Paste eliminates a lot of drudgery once you've built a few GUI apps.

As to IDEs in job ads, most companies I've seen allow their developers to use whatever they're comfortable with, so there's little point in requiring experience with any particular one.
 
Amit Ghorpade
Bartender
Posts: 2856
10
Firefox Browser Fedora Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I agree Ilja but the original poster wanted to know if IDEs can be used for GUI.
And also IDE is advised for rapid development.
Thanks
 
Phil Hopgood
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks to you all for taking the time to respond.

I don't think I made myself quite clear though, so to clarify my question;

Do many java developers in practice develop GUI apps solely using a textual approach?

I am just trying to get an idea of what is good practice, a straw poll if you will, and the reasons for adopting one approach over the other.

Having used IDEs for the last 14 years I am aware that they can be used, depending on the IDE, to produce GUIs ...... among many other things.

Ulf: Maybe you're right about companies letting the individual decide on the tools they want to use. I guess it's my Powerbuilder background colouring my view since Powerbuilder relies heavily on its' IDE (though as I said there are times you want to go in and tweak the code).

So when I am looking for contracts, Powerbuilder skill is what clients are generally looking for and since the term Powerbuilder refers to both an IDE and a 4GL I lump them both together.

Java, I now realise, is not like that since it's genesis is from the C/C++/Unix background (have I go that right?) which is predominantly text based.

I just found it odd that one would design something that was essentially visual by using a descriptive text. After all you wouldn't ask a guy to build your house by giving him a worded description of it, you'd give him a set of drawings. Same with graphic artists

........ but having said that when I design a web page I purposely use a textual approach (HomeSite)

..... so maybe I should look more closely at designing GUIs manually

... hmmmm I'll have to think about it.
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Phil,

Note that most Java programming doesn't involve AWT/Swing at all; most Java programming these days is server-side code, with GUIs in HTML. There are plenty of GUI builders, both for browser-based and desktop-based apps, and there are people and shops who use them, but I think you'll find that many if not most Java GUIs are, indeed, built with code rather than a graphical builder. The reason being that good hand-built GUI code is smaller, easier to maintain, and easier to test -- all qualities that the Java community places a premium on. Perhaps this is because there isn't a single unifying IDE, it's important that Java code be usable with different tools over time and space, and avoid vendor lock-in -- really good reasons to avoid GUI builders.

One thing that you many find that's a basic philosophical difference between the PowerBuilder world and the Java world is that Java applications are usually built with a strict separation between layers; many of the available tools try hard to make this possible. Because Java apps are built in separate layers, and technologies are mixed-and-matched across the layers, you don't have the single unified toolset that PB gives you. Instead, IDEs like Eclipse and Netbeans are themselves a sort of bazaar of different plug-ins that do different things; you can use whichever JSP editor or database tools or GUI designer is most suited to a particular task.
 
Phil Hopgood
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Ernest,

That's a very useful comment.

You may just have saved me from devoting too much effort on replicating and honing my GUI skills using SWING when I should have been concentrating on server side and HTML....... and, point taken re hand coding GUIs.

Thanks very much!
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just to back up Ernest's post a bit I too hand code Swing rather than using GUI builders. Most GUI builders use Gui Builder friendly layout managers (Netbeans' Matisse) which means that when it does come time to dig and and tweak some things it is much too complex. Not to mention just general code generation engine's really stink.

That said, I have lately been using a tool that allows you to define your UI in a YAML based file while all the grunt work is done in a Java file. The YAML file just takes care of things like:

button = new JButton("Push Me");

While the Java file handles all the events and what not. This has allowed me to keep my java files quite a bit cleaner. There are many libraries available that let you do this, most will have you define the UI in XML rather than YAML. Its just preference.

Also, helpful hint, when developing Swing GUI's Miglayout is your friend. It is a layout manager designed for hand coding UI's. I use it for nearly all my complex layouts.
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Gregg's point about using a markup language is a good one. Occasionally I've used Thinlet as an XML wrapper around AWT. It moves the GUI definition to an external XML file. Now, Thinlet doesn't support Swing, so it's missing a lot of functionality you'd want in a complex app, but it illustrates the point.
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Besides Thinlet, there are other tools / libraries that allow you to declare your GUI with an XML file. Here's a list of open source XML UI Toolkits in Java.

Even in the standard Java library there is (limited) support for this; have a look at the classes XMLEncoder and XMLDecoder in the java.beans package. The API docs of class XMLEncoder contain an example of how to use this for a Swing GUI.
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
BTW, here is a link to the library I've been using. I wouldn't say jump right into any of these until you are comfortable with Swing. But just to give you some future pointers.
 
Phil Hopgood
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks once again everyone for your inputs, they're all very much appreciated.

It's great to find a site that treats newbies as human and gives such excellent help and advice instead of the usual load of rhetoric!

Ah well, gotta hit the books and the tutorials now.

c ya.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic