Java Forum / General / June 2007
newbie
JB - 07 Jun 2007 14:54 GMT Hello all,
I have been programming in .NET for a number of years now and I would to take start experiment with java. To this end I have downloaded eclipse, but I cannot seem to figure out how to use it. I am initially interested in writing applications for desktops and PDAs, can anyone recommend suitable books or online resources for learning Java and Eclipse, especially useful if it is done from the perspective of someone coming from a .NET environment.
Alternatively if there is a preferred IDE to Eclipse that, would also be useful, although at this stage at least I do not want to pay for anything.
As I say my initial desire is to develop desktop/PDA applications rather than web based applications.
Thanks.
Ian Wilson - 07 Jun 2007 15:14 GMT > Hello all, > > I have been programming in .NET for a number of years now and I would > to take start experiment with java. To this end I have downloaded > eclipse, but I cannot seem to figure out how to use it. Google is your friend, "Eclipse java project tutorial" gets you https://eclipse-tutorial.dev.java.net/eclipse-tutorial/part1.html Which looks good to me.
> I am > initially interested in writing applications for desktops and PDAs, > can anyone recommend suitable books or online resources for learning > Java and Eclipse, http://java.sun.com/docs/books/tutorial/
> especially useful if it is done from the perspective > of someone coming from a .NET environment. Depending on what you mean by .NET, these may be of help: http://en.wikipedia.org/wiki/Comparison_of_C_Sharp_and_Java http://www.harding.edu/fmccown/java1_5_csharp_comparison.html
> Alternatively if there is a preferred IDE to Eclipse that, would also > be useful, although at this stage at least I do not want to pay for > anything. NetBeans is free from Sun. But I suggest you give Eclipse some more time and effort before you give up on it.
> As I say my initial desire is to develop desktop/PDA applications > rather than web based applications. I recommend you use Java Standard Edition (JSE) to start with. Use Swing components to create the desktop GUI.
I've not developed for PDAs, it needs a different edition of Java. I suggest you create at least a few simple desktop apps before progressing to PDAs.
Lew - 07 Jun 2007 15:23 GMT > http://java.sun.com/docs/books/tutorial/ All kinds of tutorials come from them: <http://java.sun.com/docs/books/tutorial/reallybigindex.html>
JB wrote:
>> Alternatively if there is a preferred IDE to Eclipse that, would also >> be useful, although at this stage at least I do not want to pay for >> anything.
> NetBeans is free from Sun. But I suggest you give Eclipse some more time > and effort before you give up on it. I like NetBeans www.netbeans.org myself, but there are many others. I'm also partial to emacs.
>> As I say my initial desire is to develop desktop/PDA applications >> rather than web based applications.
> I recommend you use Java Standard Edition (JSE) to start with. Use Swing > components to create the desktop GUI. > > I've not developed for PDAs, it needs a different edition of Java. I > suggest you create at least a few simple desktop apps before progressing > to PDAs. I'd suggest further that you start with console apps - no GUI - until you get the hang of Java as a language and environment. There are lots of tricks and traps in the GUI world that'll break your heart if you're still trying to correlate directories to packages.
Once you can compile apps by hand there's Ant, ant.apache.org, that is a must-have for Java development.
IBM is a good source for things Java - http://www.ibm.com/developerworks/java .
 Signature Lew
Andrew Thompson - 07 Jun 2007 15:51 GMT ...
>I have been programming in .NET ... ... (..will try Java..)
> ...I do not want to pay for anything. I think Ian and Lew have covered most of the technical aspects of what you asked. I just wanted to chime in to add that there are so many free tools for Java development that (usually) if someone were to mention a tool that actually costs money, they would specifically mention* that.
* Then spend the next five paragraphs justifying why their recommended tool is *so* good that the makers dare to actually ask money for it.
I imagine it is a very different situation, to developing using .NET. ;-)
 Signature Andrew Thompson http://www.athompson.info/andrew/
JB - 07 Jun 2007 16:13 GMT Thanks for all the advice, it is very useful, actually there is the free Express edition for .NET now adays, but I agree with you in that generally I default to assuming that something must be payed for rather than free.
Anyway, I will start with a console app as you Lew suggests, I have found a book here on Java that also starts with console type apps and I will just work my way through it.
I may be being naive here, but it appears that there is no GUI designer in Eclipse allowing me to drag and drop controls onto a blank form, am I right in this, is it a requirement to create all controls manually in code? (I am not complaining here, just trying to understand).
Also from the reading I have done so far, it seems I have to use a command line to launch a java app ->java MyApp.jar for example, is this also true or is it possible to create a normal executable.
Thanks.
Andrew Thompson - 07 Jun 2007 16:27 GMT ...
>I may be being naive here, but it appears that there is no GUI >designer in Eclipse allowing me to drag and drop controls onto a blank >form, AFAIU there are plug-ins available for Eclipse. NetBeans has 'Matisse'.
>..am I right in this, is it a requirement to create all controls >manually in code? (I am not complaining here, just trying to >understand). D'n'D' GUI designers do not work nearly as well with Java as they perhaps do with .NET. The reason is because Java compopnents might be rendered on any number of OS's, with any number of default font sizes, across different Java versions and PLAF's (pluggable look and feel), the 'put it here' style designers will often result in overlapping components* on other machines.
* Or any number of other problems.
Instead, Java has a number of layouts designed to arrange components in .. - grids over a container, - around the borders of a container, or - flowing from left to right, top to bottom (as a few examples) that are combined to organise the GUI and ensure that it is the right size for any set of desktop constraints.
These layouts do not lend themselves as well to the D'n'D 'put the component here' style GUI desingers.
(I speak as someone who does not use the D'n'D style layout designers, and feels they are rather limiting and kludgy - others swear by them.)
Mark Space - 07 Jun 2007 18:38 GMT > (I speak as someone who does not use the > D'n'D style layout designers, and feels they > are rather limiting and kludgy - others swear > by them.) I'm a swear by them person. Matisse is great; it uses the Spring layout manager which does not have the problems Andrew mentions. All components are positioned relative to each other. A change in size in one means the rest are moved logically so they maintain distance and layout alignment. Top level components are resized appropriately so that all their sub-components fit.
(Note I don't have nearly Andrew's level of experience, but so far there are no issues for me with Matisse, given some moderately complex GUI's.)
Eclipse is good but NetBeans is worth knowing also. It handles desktop apps just fine, and comes with Matisse by default. All you need is the J2SE JDK and NetBeans and you can jump right in. Matisse is no longer a "plug in" that you need to download separately. (It still is a plug-in but it's already "in" by default, if you see my meaning.)
JB - 08 Jun 2007 08:34 GMT Thanks all, I have already started working my way through the book and so far I like what I see.
Mark Space - 08 Jun 2007 08:57 GMT > Thanks all, I have already started working my way through the book and > so far I like what I see. Just curious: which book are you using?
JB - 08 Jun 2007 11:19 GMT It's an old Teach yourself Java 2 in an unfeasibly short time by SAMS that I found lying around (published 7 or 8 years ago so don't know have valid it is anymore, but it seems to be working so far. I figure I will go through that and see what happens after that.
I've also found an O'Reilly Java Cookbook (also published a while ago), but I haven't looked through this yet.
Do you have any other recommendations?
Also, I can't seem to make an .exe file from a Java application, I have to use java MyApp.class from the command line. I am assuming making an exe possible, can you tell me how this is done?
Gordon Beaton - 08 Jun 2007 11:46 GMT > It's an old Teach yourself Java 2 in an unfeasibly short time Not really an answer to your question, but this comment reminded me of an appropriate paper by Peter Norvig:
"Teach yourself programming in 10 years" http://norvig.com/21-days.html
/gordon
--
Andrew Thompson - 08 Jun 2007 12:01 GMT >It's an old Teach yourself Java 2 in an unfeasibly short time by SAMS >that I found lying around (published 7 or 8 years ago so don't know >have valid it is anymore, but it seems to be working so far. There are a number of new things intorduced, such as Generics, but that book should give a reasonable overview of most of the keywords and language constructs.
>...I figure >I will go through that and see what happens after that. Try to keep a late model JavaDocs handy, you might be hitting deprecation errors in some classes and methods (hopefully not too many).
>Do you have any other recommendations? The Java Tutorial - free, (relatively) up to date, direct from the horses mouth. It can be browsed online, or downloaded for local viewing (If you specifically requested books earlier - my apologies).
>Also, I can't seem to make an .exe file from a Java application, I >have to use java MyApp.class from the command line. By collecting the classes in a Jar file, you can add a manifest that specifies the main class. When a Jar with manifest is double clicked, it will open and run.
Further, you can launch/install Jars using web start. Web start can specify things like download strategy (for automatically updating the application), icons (for desktop shortcuts and menu items) file associations..
>..I am assuming making an exe possible, .. Possible yes - a good idea, no. <http://www.physci.org/codes/javafaq.html#exe>
 Signature Andrew Thompson http://www.athompson.info/andrew/
JB - 08 Jun 2007 12:14 GMT I think I am getting a better overall understanding here.
Thanks for all the help.
Lew - 08 Jun 2007 12:49 GMT > I think I am getting a better overall understanding here. > > Thanks for all the help. Don't let old books train you to use the Vector and Hashtable classes. Use ArrayList and HashMap instead.
 Signature Lew
Mark Space - 08 Jun 2007 19:50 GMT > It's an old Teach yourself Java 2 in an unfeasibly short time by SAMS Eww. Get something newer. I've been using O'Reily _Learning Java_ 3rd edition. It's a huge tome but still can't cover everything. But between that and Sun's online tutorial, you can definitely learn 90% or so of what you need to know.
> Also, I can't seem to make an .exe file from a Java application, I > have to use java MyApp.class from the command line. I am assuming > making an exe possible, can you tell me how this is done? No can do, boss. Remember that Java runs everywhere, not just Windows. So .exe files have no meaning really on Sun, Linux, *BSD, etc.
It should be possible to configure your Windows box to run .jar and .jnlp files just like .exe files. Java 1.6 installer did this for me, I think, so I'm not sure of the details. It would be good for both of us to learn them eventually, I guess.
Arne Vajhøj - 09 Jun 2007 19:33 GMT > .. >> I have been programming in .NET ... [quoted text clipped - 15 lines] > I imagine it is a very different situation, to developing > using .NET. ;-) Actually there are a lot of free stuff available for .NET including a lot of JFoobar ports to NFoobar.
Arne
Free MagazinesGet these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...
|
|
|