• 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

Some questions about java,swing and javafx

 
Ranch Hand
Posts: 424
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys,

im new here...

just trying to work out what my best direction would be...

i been playing with java the last few months (was playing with python for 6 months prior to that)
a friend of mine convinced me to drop python for java (not that he didnt like the language,just thought i would learn more at this stage from java)

so i been making my stupid coin tossing and card shuffle console programs etc etc

i am very interested in GUI's and user interfaces

i read that swing is dead and that you shouldnt use it,rather use javafx

but i have recently read bad things about javafx to...that it is on the way out...but not quite

my problem is this...

at this stage i am a hobbyist programmer who would like to enter the work place in a few years (3-4) time.
i dont want to waste my time on technologies that will not benefit me in future.

i do understand that java desktop publishing is pretty much dead...its all going towards android
and i do understand that java is being wiped out by js in the front end...is it still used in the back end a lot?

so where does java fit in? where should i be focusing on?

it is my dream to build a GUI management software that talks to a database on my linux server over the internet...things like this
but is this going to benefit me in my later years? is it something that can help me get a job...or am i better off completely
focusing on android?

any push in the right direction would be appreciated

thanks for reading

 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Short version: where I see Java used most often (in fact, pretty much 100% for me) is the back end of web applications.
 
Bartender
Posts: 1464
32
Netbeans IDE C++ Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch!

jon ninpoja wrote:i read that swing is dead and that you shouldnt use it,rather use javafx
but i have recently read bad things about javafx to...that it is on the way out...but not quite


Well...

I assure you, you can find someone somewhere who will tell you that absolutely any technology is one, or all, of the following:

  • Dead.
  • No longer supported.
  • Soon to be replaced.
  • Only used on servers, desktops, iPads, secret DARPA mainframes, or an abacus.

  • Oracle certainly said that it planned for JavaFX to replace Swing. That was a while back, and it hasn't happened. Indeed, it seems to me that a certain retrenchment on that plan materialized when they dropped their support of SceneBuilder, the JavaFX GUI editor. I know some programmers who say they don't use a GUI editor, but I believe many do (I'm one) and, for a new programmer, I think a GUI editor is a very helpful tool. The Matisse GUI editor, which is built into NetBeans (the IDE I use), and probably others, works with Swing. It generates some questionable code, but it does work. Also, a large part of the Jave SE standard library is devoted to Swing. I'm confident that library code will be around for a long, long time.

    So, "Swing is dead" is something I, personally, believe people say mostly to be shocking or feel smug. It exists, it works fine, it is thoroughly documented, and still the only GUI library with built-in editor support in my IDE. I use it.

    But...

    I would venture this advice: Swing's programming model is a lot like many GUI programming models. If you learn to use it in your code and, one day, discover that something unprecedented has happened (namely, that a lot of internet wags making shocking statements and feeling smug about them turned out to be right), it won' t mean you've wasted your time and will have to start over again. Learning Swing means learning concepts and techniques that migrate well to other GUI systems.

    I guess I've been programming GUIs since maybe 1981(?). That includes Windows, X Windows, SunView (that one really is dead), curses, Swing, and Windowpanes (no, you've never heard of "Windowpanes," because I wrote that one myself, just before Microsoft released "Windows," and, yes, I cry myself to sleep some nights over that). Here's what I have to tell you after 35 years of it: if you can handle one of them, you can handle all of them. JavaFX actually has a few features that are somewhat distinctive, but that's often as much of a reason to avoid a software tool as it is to embrace it. For a new Java programmer, I would say start with Swing, but don't dig into to it on purpose. Use it to build the GUI you need for your application and, when you don't know how to do what you want, use that as the reason to dig a bit more. A carpenter would tell you to buy your tools when you need them. Approach Swing the same way: learn more about it when you need to. If and when you find a need to move to another GUI system, your Swing skills will help you do so.

    And, of course, when you get stuck, come back and ask for help. We have that here!
     
    Stevens Miller
    Bartender
    Posts: 1464
    32
    Netbeans IDE C++ Java Windows
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    Bear Bibeault wrote:Short version: where I see Java used most often (in fact, pretty much 100% for me) is the back end of web applications.


    Whereas I, on the other hand, do nothing but desktop applications.

    Then again, because I must work with webcams and make a lot of use of a vulgar native data type that Java doesn't have, I also write a lot of my code in C++ and call it from Java via the Java Native Interface (JNI). Using JNI is widely regarded as the equivalent of practicing a satanic art, and it is a bit complicated, so I don't recommend it for beginners. Again, it's one of those things you shouldn't bother with until you realize you need it. (But never underestimate the power of the Dark Side.)
     
    Sheriff
    Posts: 7125
    184
    Eclipse IDE Postgres Database VI Editor Chrome Java Ubuntu
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    I often think of Java as the language in the middle, creating JS or communicating with a web framework towards the front and calling web services or databases towards the back.

    I also do little desktop apps and I use JavaFX and SceneBuilder.  You can see one of those here.
     
    Ranch Hand
    Posts: 118
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    jon ninpoja wrote:at this stage i am a hobbyist programmer who would like to enter the work place in a few years (3-4) time.
    i dont want to waste my time on technologies that will not benefit me in future.



    My experience matches what Bear and Stevens already posted: there's far more Java work on web applications (mainly back end / web services) these days, so if having the most marketable job skills is what you want then you should focus on back end (RESTful web service) development. If you do go with this approach then you should also seriously consider learning JavaScript, which is often used for the front end (UI) on web applications.

    However, if you're determined to stick with desktop development then as Stevens said, Swing is the way to go. It's only "dead" in the Oracle marketing department, whereas JavaFX never took off in the first place and there's no reason to believe that will ever change. Go to any of the job boards and see how many Swing jobs there are versus JavaFX. Or check the relative amount of activity on here for Swing versus JavaFX. Or look on Stack Overflow. You'll see what I mean.
     
    Stevens Miller
    Bartender
    Posts: 1464
    32
    Netbeans IDE C++ Java Windows
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    Brett Spell wrote:Or look on Stack Overflow.


    Dear God, man, don't send a beginner to StackOverflow! They eat beginners alive there and use their bones to pick their teeth.

    But, yeah, it is a good idea to look at the job postings and see what's in demand, if you're looking for professional opportunities. Now, for someone who considers themself to be a "hobbyist" programmer, I'd say it's premature to look at the job listings. Instead, write programs that interest you. Eventually, you'll realize what you're good at and might like to try getting paid to do. Take it from me, writing boring programs is a very dreary way to make a living, and a sure way to lose interest in programming altogether. Heck, writing boring programs had a lot to do with why I went to law school...
     
    jon ninpoja
    Ranch Hand
    Posts: 424
    3
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    thanks guys,

    i really appreciate all the input!!! and will take it all on board

    thanks again
     
    Brett Spell
    Ranch Hand
    Posts: 118
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    Stevens Miller wrote:

    Brett Spell wrote:Or look on Stack Overflow.


    Dear God, man, don't send a beginner to StackOverflow! They eat beginners alive there and use their bones to pick their teeth.



    You're right: I should have clarified that Snark Overflow is prescribed for external (google) use only.
     
    Ranch Hand
    Posts: 167
    Netbeans IDE C++ Java
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    I started off with Swing and programmed it for years.  
    When I started doing JEE, I asked pretty much the same question
    At that time, Flex and Actionscript was the best answer.
    I liked both Swing and Flex because they both were Large Application type front Ends.
    But then HTML5 came and so much is going towards mobile devices
    Most HTML5 type frameworks seem to use JavaScript or ActionScript like code.
    The I looked at a few recently and of the ones I looked at Bootstrap seemed to standout for me.


    As for java, Its still active on the backend.  Though everything seems to be more of a framework.
    If you want to work for someone, you will need to know frameworks.  
    If you want to work for yourself, you should design your own framework.  But realize as soon as you get it developed, it will be obsolete.  
    I have been programming since 1979 and that has been the fact of life as a programmer.  As soon as you get good at, its obsolete.

    The good thing about Java is that java script is not all that removed from it.  And Javascript is still doing well in the front ends.

    Hope this helped.
     
    Bear Bibeault
    Sheriff
    Posts: 67746
    173
    Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    Michelle Streeter wrote:The good thing about Java is that java script is not all that removed from it.


    Not really. While they possess an unfortunate similarity in naming, and a syntax rooted in C, they are completely different languages and have very little to do with each other. In fact, I've often said (only half jokingly) that knowing Java is a detriment to people trying to learn JavaScript.
    reply
      Bookmark Topic Watch Topic
    • New Topic