• 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

Java for writing desktop apps? Is it good?

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello

I don't know if this section is good for questons like that, I hope it does

Well... I've wrote few simple apps in Java + Swing and it was OK

But main problem for me is Java need more and more code for simple things - in other languages simple operations like read user data from keyboard and output it on monitor are done in 2-3 lines of code, in Java...much more lines Sometimes I've had a feeling that I'm "wasting" my time, because application X could be finished in Python (as example) much more faster.

Plus - Oracle seems to going more and more to support J2EE rather than providing features for desktop apps. Some programmers in my job agreed with that too.

So - is Java good for writing standard, modern desktop apps? Python and other languages seems to have more modern libraries and less code ( it means faster learning and faster writing).

Sure - Java is good because from pure Java to Android is only few steps, writing GUI in Swing is easy, J2ME is great idea too and those thins keeps me with Java. I'm not interested about J2EE, Applets or something - I just want to write pure desktop apps.

But to know Java good - it takes years and maybe to write modern desktop apps it will be better to know Python with Qt? After few apps with Java I have this little crisis - turning back or going further.


Best Regards,
Krystian_27
 
Bartender
Posts: 3648
16
Android Mac OS X Firefox Browser Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Desktop GUI apps hmm? I used to love writing them (Swing) back in my SCJD cert days.

But now ... not really. Well I still have a desire to write GUI but not specifically for desktop per se. Since JavaFX comes out, it meant to run on desktop and on the web. Yippee a GUI for both worlds right?

But further research today I sort of found out JavaFX may not be a good choice for GUI apps. Then what is?

Hmm what do they call it... oh yeah installable internet application (IIA). One example of such is Apache Pivot.

Anyway not much from me here since I'm kind of researching what to use for GUI apps (Swing/AWT, SWT/JFace, JavaFX, etc) if I'm making one.

Hope this helps a bit.
 
Ranch Hand
Posts: 10198
3
Mac PPC Eclipse IDE Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How about Java Web Start? http://docs.oracle.com/javase/tutorial/deployment/webstart/
 
Bartender
Posts: 1210
25
Android Python PHP C++ Java Linux
  • Likes 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

is Java good for writing standard, modern desktop apps?


Both as a user and as a programmer, I'm a fan of desktop apps.
If I have some idea I want to prototype or a tool I want to create, I invariably do it as a desktop app rather than a web app.

From that perspective, I find JavaFX + SceneBuilder very good. I find appearance of JavaFX controls much better than those of swing, even those of some of the better swing L&F like Nimbus.
The embedded webkit control of JavaFX allows me to write hybrid apps which display external website content inside a traditional desktop UI.
For example, I've been using a desktop mapping tool I wrote using JavaFX, where a google map is shown inside the webkit control but all the UI and logic related to points of interests are implemented using JavaFX controls and traditional desktop GUI concepts like toolbars.
The 2D and 3D graphics capabilities of JavaFX are much better than Swing.
You should check out the JavaFX Ensemble demo app to get an idea of its capabilities.

other languages seems to have more modern libraries


Can't say I agree with that. What library are you missing in Java? What do you mean by modern?

...and less code


This I can agree. I still think of Java as verbose despite years of programming in it.
Python+Qt is definitely less code, while CPP+Qt I find even more verbose than Java but I enjoy it more for some inexplicable reason.
I've never tried it but perhaps you can try some other JVM based language such as Scala or Jython to build JavaFX apps. That way you get a good UI framework but without the verbosity of the language.
 
Marshal
Posts: 79242
377
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Krystian Janik wrote: . . . simple operations like read user data from keyboard and output it on monitor are done in 2-3 lines of code, in Java...much more lines . . .

Yes, Java® does take longer to write than some languages. Part of that might have been a reaction against the sort of hypercompressed code you can see in some C books.You will find use of λs and Streams in Java8 makes the code more concise, and it has a more declarative style now.

But the language is only a minor part of programming. Once you learn to program OO does it matter whether you use Java or Eiffel or SmallTalk or Python or Simula? I suspect it takes just as long to learn any one of those languages as the others; what takes the time is learning programming at all.
No, Java has gone out of fashion for desktop apps. In fact fewer people are writing desktop apps nowadays; most things are now done on the web. Look at this part of the JDBC Tutorial, and look at the three‑tier architecture. Forget that “Java applets” appears anywhere on that diagram, and you see that the part done in Java® is the connection between the database and the web server. The webpage part of the app is often written in HTML/JavaScript etc etc.
I think Java® is worth learning, but remember that it is only part of your programming armamentarium and you will be working alongside people writing different languages.
 
Campbell Ritchie
Marshal
Posts: 79242
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Discussion moved as too difficult for “beginning”.
 
Krystian Janik
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank You all for responses. I've heard about JavaFX but I thought it's more for web-apps rather than desktop applications. Swing is not bad - drawing GUI is simple I see Java as a good language and robust, but long-code and long-term-learn at the same time. If I don't want to program for Android, web-apps or J2EE - maybe there are some better languages to fast-coding apps (and faster to learn)? I just want to code desktop apps - no more, no less.

Karthik Shiraly wrote:
Can't say I agree with that. What library are you missing in Java? What do you mean by modern



Well... Facebook I think dropped API for Java (I've searched about it some time ago and found info like that). Looking at Python and Qt I found many things as native, or as almost new libraries for easy operations on movies, music, images, operating deep on system rather than touching it (I've tried to import linux console into Swing windows and it was faster to call xterm window with parameters). To write simple games there is SDL in Python, actual bindings to Qt or GTK etc. In Java - everything seems little...outdated in terms of desktop? Sometimes even fan-made libraries are dropped long time ago. None of programming language is simple but Java seems to require long-term-coding to know it well, when Python seems faster to learn and start to making good apps in short period of time.

I don't know, I'm not a programmer - just normal user who read one book about Java and wrote few simple apps - don't get me wrong please
 
author
Posts: 23951
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I actually agree with the OP on this one. Certain languages are just better at prototyping than others. And if the OP only wants to quickly write small apps, what's wrong with using Python?

Henry
 
Karthik Shiraly
Bartender
Posts: 1210
25
Android Python PHP C++ Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm not aware of the facebook thing, but usually any language api for such social media services are nothing more than wrappers around their HTTP web service APIs, so I don't believe it's a big thing.
It's true that support for movies and music was kind of outdated in the core libraries for a long time, but 3rd party libraries like the xuggler wrapper for ffmpeg solved that easily. And now JavaFX has extremely good support for movies and music.

Image support on the other hand has always been good in the core library.

As for games, a java games programmer would probably pick libgdx or jgl. If there is no java SDL binding, I'm not sure why that is, but my point is that good alternatives were available to programmers.
Minecraft, the 2nd most popular game ever, is written in Java (uses swing, I think).
Now JavaFX too is a good option for games, because all its 2d and 3d graphics rendering is done using Direct3D or OpenGL on GPU (unlike Swing rendering).

For GUI frameworks, again a java programmer would always pick Swing and now JavaFX because they are both comprehensive enough to build an entire GUI without requiring any native framework like Qt/GTK.

Personally, I don't think java desktop support is outdated, though I'd describe the treatment it gets both from Sun/Oracle and from the java programmer community as somewhat neglectful. Java's niche is enterprise web apps, so most of the community are enterprise web app programmers, and that's where most of the development efforts go. Luckily, it does provide substantial support for other kinds of programmers too.

In the end, I think one should simply use the tools they are comfortable with, if they have such a choice.
JavaFX does have a learning curve, and if you are already looking at java as tedious, that learning curve will only look steeper.
It looks like you already enjoy python, and are comfortable with it, so I think you should continue with it.

 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Krystian Janik wrote:Thank You all for responses. I've heard about JavaFX but I thought it's more for web-apps rather than desktop applications.


No, for webapps most people would use an UI based on HTML5 + CSS + JavaScript. You could make a webapp with a Java applet that uses JavaFX, but applets have never been hugely popular.
 
Bartender
Posts: 1359
39
IBM DB2 Netbeans IDE Spring Java
  • Likes 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Krystian,

at the moment I'm involved in an ERP project which client part is a desktop Java application, based upon swing. I agree with you with the fact using swing often requires a remarkable amount of boilerplate code - I have in mind, for example, JTable usage: you have to deal with "model" and "view" and filling a table requires a lot of code. Anyway, in my very humble opionion Swing has got an advantage with respect other languages' desktop GUI frameworks: it's highly customizable. At work, we created a lot of effective custom components to hide all the complexity of dealing with some difficult details like Document (to limit input box to a certain length or to allow only numeric characters) or TableModel (to fill a customized JTable with the content of a Collection of items). It has been a long work, but results are impressive, and there weren't so many technical details to handle to achieve such a result. I mean, to extend a .NET component, I think you need much more knowledge of .NET fx with respect to Java Swing. More important, we were able to add them to NetBeans's custom palette and used them all over our project.

So said, I have to admit that nowadays a web-based application is what most of customers expect you to develop, so it doesn't matter if you are using Java + Swing or C# with Windows Forms. You should adopt a web-based technology when possibile and reasonable. To be honest, I'm not a good web programmer - the few works I completed in that ambit were really simple ones, and I prefer by far desktop or server side programming stuff: my only advice on web application is to avoid to use specific java / .NET language frameworks and focus on html + css + javascript.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic