views:

143

answers:

8

Hi guys, i would like to learn Java to create cross platform desktop application. I know Java syntax, but i'm trying to learn Java Api. Does exists some book / resource that help learning main core Java API, the Swing, etc ? I'm new to Java and i'm little confused because of the "Mastodontic" API !!! Thanks in advance

+4  A: 

I don't think anyone knows all the Java API. It's quite large. You learn bits and pieces of it as you use it.

The best advice I have for you is to keep the API bookmarked and look at it often.

Starkey
+1  A: 

Thinking in Java is an very popular book for learning Java and associated APIs. The N-1 edition is available for free download, from the book's site.

I found the official tutorials quite helpful too, particularly when diving into file and network IO.

Michael Petrotta
+1  A: 

This famous question has some good starters, take a look. Most Java books focus on the API, btw.

Andreas_D
+1  A: 

If you are interested in Swing, I have found Java Swing, published by O'Reilly, to be invaluable while learning it. It is a little dated (1.4), but it is still mostly correct and up to date.

aperkins
A: 

These introductions from Java creator Sun Microsystems (now part of Oracle) look at a glance like something I wish I'd had when learning.

The decade-old books below by David Geary were my original introduction to Swing. I still find myself referring to them on occasion. APIs that have changed have typically been extended rather than overhauled.

Andy Thomas-Cramer
A: 

Learn the .NET Framework instead. .NET programmers get paid more, and the new Windows Phone supports XNA games. Some games made for the XBOX have been easily ported over to Windows Phone. Furthermore, Silverlight is also supported on Windows Phone. Don't waste your time learning a dying language.

The same Silverlight application can also run on both the Web, Desktop, or on a Silverlight Enabled Phone such as the Windows Phone, and Nokia is jumping on the Silverlight bandwagon.

Additionaly, as someone is concerned .NET can be ran on multiple platforms. There are several runtimes available; the most popular being MONO.

Breakskater
The questioner specifically stated he or she is working on cross-platform software. In addition, according to the Tiobe index, Java is the most widely used programming language in the world -- it is flourishing. (C# is at #6.)
Andy Thomas-Cramer
The Tiobe index is not an accurate indicator of the Best Language to use. It only uses keywords that are entered into a search engine. JAVA is a language that is losing integrity. It runs slow and takes longer to develop application in it. And, BTW, C# is a language that can be ran on multiple platforms using the MONO runtime and other runtimes. It is also not the only language that can be compiled to run with the .NET runtime there are many languages such as F#, VB.NET, Python, Ruby, and more..
Breakskater
According to ComputerWorld, C# is the most popular language.
Breakskater
The real problem with your answer is that you are not answering his question. He specifically mentions Java.
aperkins
-1. I don't agree with your premise that Java is a dying language (I'd say it's maybe at it's Apex but certainly not dying), but even if it were, the Java API is applicable to more than just the Java language (it would be like saying J# is a dying language so don't learn .NET) and it's irrelevant to the question anyhow.
Mark Peters
All of this is subjective and argumentative, but ".NET programmers get paid more" isn't even remotely true. Not in the UK anyway: http://www.itjobswatch.co.uk/. Java is as "enterprisey" as it gets.
Jonik
It is not irrelevant. I do not want this guy to waste his time learning a language that losing popularity faster than a bad check. And, that's just what this gentlemen will have if he continues down the JAVA path. The linux OS is also diminishing in popularity, especially after the huge virus that hit a few years ago. .NET has many languages to choose from C# is just one of them, but they all compile to one intermediate language.
Breakskater
I don't I could trust somebody who doesn't know that it's "Java", not "JAVA".
Mark Peters
Thanks but i've asked about java. I already know .NET framework (a part of it), in particular ASP.NET . But i would like to improve my knoweledge of Java (that in my opinion, isn't a dying technology). Here in Italy a lotof jobs ads contains the magic world Java J2EE :-!
stighy
@Breakskater if Java is a dying language, how come I see more adds for it than .net? *shrug* you are welcome to your opinion, I am not seeing any shortage of developers in many different languages (PhP, Java, .net, perl, python, C, C/C++, Objective-C, the list continues...) The language is not as important as the skills. Having a good reference book for APIs is important in any language, and different languages will teach you different techniques and practices, which helps with any development environment.
aperkins
There are a lot of job ads containing the magic word "Java J2EE" because there is a lack of supply of Java Programmers. The reason why is because .NET is better and pays more.
Breakskater
Learning a language for the sake of learning is a waste of time. Learning for the sake of applying that knowledge is a wise use of time. Time is the most valuable commodity we have. Most of us only live ~25,500 days in our lifetime, so why waste even a single day learning something that will only, at best, give you a lateral move? Java is a weak langauge and Windows is the more dominate OS for desktop computers. Java has always ran slower than other languages and has always took longer to develop the same functions. Java is a complete waste of time. If you want to develop fast, use VS.NET.
Breakskater
@Breakskater - you might enjoy the sister site http://programmers.stackexchange.com/.
Andy Thomas-Cramer
For instance, with .NET you can literally write once and run on Desktops, Phones, and within Web Browsers. Java has never lived up to its slogan 'Write once, run anywhere'. Write Once, Debug Everywhere is more like it.
Breakskater
@Breakskater: If ".NET pays more", can you explain why, based on thousands of job ads, the salary offered for "Java Developers" in London is **£60,000** on average, while for "C# developers" it's **£55,000** and for ".NET developers" **£45,000**? http://j.mp/aCHFFu In other words, if you are not a mere troll, provide references for your claims.
Jonik
I have never had a .NET program work on my linux box, my OS X box, a solaris box ... or my blackberry... not really seeing your claims here. However, I have written Java programs that run perfectly fine on Windows XP, Windows 7, Windows Vista, OS X, Solaris, Ubuntu, Slackware (!), and Red Hat (technically SentOS) (there might have been a few others). If you have some data, please share. However, claiming "mono" is the answer - it isn't, since it isn't even 3.0, let alone 3.5, compliant as of the last time I checked.
aperkins
+1  A: 

One approach is to always pick a well-known problem to solve and use a new language, be it Java, or C#, or whatever to program it. The benefit of using a well-known algorithm is that you don't get bogged down in the details of implementation and understand the problem so you can concentrate on solving it. you should pick something small but complicated enough to touch on multiple concepts. Database and Network connectivity, Multi-threading, UI, Events, to name a few. this will put you fast into the details of the language from multiple perspectives. One such algorithm is a game "Bulls and Cows", where you guess digits in 4 positions and get a "Bull" if you guess both position and number and a "Cow" if you only guess the number. Write this game in Java and play against the computer, then write it for the computer to play against a computer, then do a p2p and you will be well versed in Java API in no time :)

Alex
+2  A: 

As others said, no need to worry about the size of the standard class libraries. You'll learn those on an as-needed basis.

Instead of getting any of the huge "API reference" style books (most of which are out of date anyway), I think you should heed Bill the Lizzard's advice in the "best Java book" question:

Head First Java is great for beginners.

Effective Java will take you from journeyman to master.

The Head First book is a widely praised intro to Java, and covers Swing basics too. For up-to-date API details, always keep the online docs close at hand. Also, to avoid some common pitfalls, I recommend checking out these SO questions:

Jonik
+1 for a recommendation of Effective Java - I should have totally remembered that!
aperkins
Effective Java is totally great, as everyone [agrees](http://stackoverflow.com/questions/75102/best-java-book-you-have-read-so-far/75112#75112), but the point here is that one should read it *later on*, when already quite familiar with Java basics. It's *not* the book for learning about core Java APIs.
Jonik