Another Java Question

Discussion in 'Mac Programming' started by larswik, Sep 8, 2006.

  1. macrumors 68000

    Joined:
    Sep 8, 2006
    #1
    Hey this is my first post. I looked through the page for an answer to Java and I think mine is more simple. Where can I find a book on learning Java on the Mac? I was at Boarders book store and they had about 50 or so books but all the images were Windows loking and I wasn't sure if that would work on the Mac.

    I know some Lingo from using Director and bought a Unix book and have been learning the Terminal and unix functions.

    I want to build a small simple app that will allow me to commnicate with other computers (non Mac) that I have in hotels playing back video. I can use FTP to upload to the units and the TELNET commands to control the units like play, stop, list using the Terminal app. I want to bundle those simple operations into a GUI interface and I think JAVA can do that from my research. Plus I want to learn Java.

    Is there a JAVA for dumbies on Mac book that can get me started learnign JAVA?

    Thanks!

    -Lars
     
  2. macrumors regular

    peterparker

    Joined:
    Mar 12, 2005
    Location:
    Houston
    #2
    Look for a good Java Swing book. No need for a Mac specific book.
     
  3. thread starter macrumors 68000

    Joined:
    Sep 8, 2006
    #3
    Thanks, what is Java Swing? is it a non OS spacific way of learnign Java?

    -Lars
     
  4. macrumors newbie

    Joined:
    Sep 6, 2006
    #4
  5. thread starter macrumors 68000

    Joined:
    Sep 8, 2006
    #5
    Cool, I'll take a look at those Tut's. I kind of like having a book that I can flip through and I really want to start learning from the begining. This morning I didn't know what the differance were between JAVA and JAVA SCRIPT.

    So I want to start of with the basics of programing this laungage.

    It also seems like Java Swings is more of te GUI type app. is that a different version of Java or part of the same package?

    -Lars
     
  6. macrumors regular

    Joined:
    Jan 28, 2006
    #6
    Well, Java Swing is a windowing toolkit. It is the GUI classes, essentially. Buttons. Forms. Textboxes.

    Java is a write-once, run anywhere language. You can write your code on a Mac and run the interpreter to have it execute on a PC, and vice-versa.

    I don't know that a Windows Java book is going to be any different from a Mac Java book in teaching you how to program in this language. Whereas a Windows book tells you to set your ENV and HOME environment variables in a specific way, a Mac book would obviously tell you to set them differently because Unix and Windows use different commands to do the same thing.

    As someone who programs in Java in Windows and OS X, I recommend you go download Netbeans - a free Java IDE - at java.sun.com under the J2SE downloads like (either 1.4.2 or 1.5 versions will do). When you install it all of your environment variables will be set up for you AND you can just write your code in the IDE and run it from the IDE - without having to drop to DOS or Terminal.

     
  7. thread starter macrumors 68000

    Joined:
    Sep 8, 2006
    #7
    I must say this board is very fast with responses. I'm heading to LAX to pick up a friend. I will take another look at some books for Java. I'm not wanting to learn everything there is about the laungage but I would like to be able to build that app to use the FTP'ing and TELNET service that terminal offers.

    Can Java execute Unix functions? so in Java I can have it call up those functions that I use in the terminal within Java?

    Thanks again for all this fast replying. Off to LA right now.

    -Lars
     
  8. macrumors 6502a

    NewbieNerd

    Joined:
    Sep 22, 2005
    Location:
    Chicago, IL
    #8
    Yup, very simple. I think it's

    Code:
     Process p = Runtime.getRuntime().exec("ls -lhF") 
    or whatever command you want to execute. Then you can get the output and error streams from it.
     
  9. thread starter macrumors 68000

    Joined:
    Sep 8, 2006
    #9
    Cool, now that phrase that you wrote is greek to me but I will start learning Java today. I know it will take some time but i'm in no hurry. I bought JAVA for DUMMIES- 9 in 1 book that covers swing objects and others.

    Is learning SWING almost the same as learning JAVA. I know it is the same type of programing laungage but from what I understand it is a different style, is that right? I am lookign to build a GUI interface to get away from the Terminal commands but was wondering if I should skip ahead to the Swing section in the book and stat to learn that or start at the begining. A post above said I should start with Swing.

    Thanks, you guys are awsome!

    -Lars
     
  10. macrumors regular

    Joined:
    Jan 28, 2006
    #10
    Well, Swing IS Java. Sun's Java provides two toolkits to build graphical user interfaces. One is the AWT (Abstract Windowing Toolkit) and the other is Swing. There are some third-party GUI classes as well (one called SWT comes to mind).

    But if you're going to learn Swing you need to learn the rest of Java. Having a firm grasp on concepts such as instantiating objects, loops, variable scope, methods, properties, public/protected/default/private class scope are all important to your success. If you already know all of that, go for it! But if you don't know Java, you're not going to be able to write and understand an app with a Swing interface until you know how to call methods and instantiate objects.

     
  11. thread starter macrumors 68000

    Joined:
    Sep 8, 2006
    #11
    That works for me. I will start with the Java basics in the front of the book. Also I will look at the info from the Sun site that someone else posted here.

    Thanks again for all yor help. It's nice to find a freindly all knowing fourm : )

    -Lars
     
  12. macrumors regular

    x704

    Joined:
    Apr 15, 2006
    #12
    I second downloading and using NetBeans IDE.

    I would also pick up a couple of good books on the subject of Java. I recommend JAVA Software Solutions Foundations of Program Design second edition by John Lewis and William Loftus ISBN 0-201-61271-2 for a decent tutorial. And for a reference I recommend Beginning Java 2 by Ivor Horton second Covers JDK 1.2 ISBN 1-861002-23-8. Both are the best books I have seen, also if you can try to get the same books only for JDK 1.4 (Java Developers Kit). The big book covers applications written in java too unlike most.
     
  13. thread starter macrumors 68000

    Joined:
    Sep 8, 2006
  14. macrumors regular

    Joined:
    May 19, 2006
    #14
    im taking comp sci at school and we use jcreator.. cause its free.
     
  15. thread starter macrumors 68000

    Joined:
    Sep 8, 2006
    #15
    Looking at the Sun site they use xcode as the IDE in their examples. I guess there are alot of tools (IDE's) to help you program in Java. The apple site talks about Eclipes, Sun site shows xcode and I am now downloading Netbean IDE.

    I'm going to try Netbean to start. thanks for all the options!

    Now on to page one of the learning Java book!

    -Lars
     
  16. macrumors regular

    peterparker

    Joined:
    Mar 12, 2005
    Location:
    Houston
    #16
    Eclipse is arguably the most popular Java editor. After that, NetBeans, JBuilder, IntelliJ are some of the top Java editors.
     
  17. macrumors newbie

    Joined:
    Sep 10, 2006
    #17
    AWT vs Swing

    I am another newbie to this forum.

    Swing is not implemented using any native code. One problem with AWT is because it used the native code on each platform it was restricted to features present on every platform.

    You can still use AWT but Swing is preferred.
     
  18. macrumors 6502a

    richard4339

    Joined:
    Sep 6, 2006
    Location:
    Illinois
    #18
    At my school, we just use Textpad. No IDEs for us! Since my migration to Mac, though, I've started using Textmate.
     

Share This Page