Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Sep 8, 2006, 03:48 PM   #1
larswik
macrumors 65816
 
Join Date: Sep 2006
Another Java Question

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
larswik is offline   0 Reply With Quote
Old Sep 8, 2006, 03:51 PM   #2
peterparker
macrumors regular
 
Join Date: Mar 2005
Location: Houston
Send a message via AIM to peterparker
Look for a good Java Swing book. No need for a Mac specific book.
__________________
Zen - flickr
peterparker is offline   0 Reply With Quote
Old Sep 8, 2006, 04:01 PM   #3
larswik
Thread Starter
macrumors 65816
 
Join Date: Sep 2006
Thanks, what is Java Swing? is it a non OS spacific way of learnign Java?

-Lars
larswik is offline   0 Reply With Quote
Old Sep 8, 2006, 04:05 PM   #4
larsf
macrumors newbie
 
Join Date: Sep 2006
Java on Mac

You dont need any mac specifics for an application like that, check out the tutorials on this page.

http://java.sun.com/docs/books/tutorial/
larsf is offline   0 Reply With Quote
Old Sep 8, 2006, 04:11 PM   #5
larswik
Thread Starter
macrumors 65816
 
Join Date: Sep 2006
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
larswik is offline   0 Reply With Quote
Old Sep 8, 2006, 04:12 PM   #6
atmenterprises
macrumors regular
 
Join Date: Jan 2006
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.

Quote:
Originally Posted by larswik
Thanks, what is Java Swing? is it a non OS spacific way of learnign Java?

-Lars
__________________
Download LetterFool in the App Store.
atmenterprises is offline   0 Reply With Quote
Old Sep 8, 2006, 04:23 PM   #7
larswik
Thread Starter
macrumors 65816
 
Join Date: Sep 2006
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
larswik is offline   0 Reply With Quote
Old Sep 8, 2006, 04:35 PM   #8
NewbieNerd
macrumors 6502a
 
Join Date: Sep 2005
Location: Chicago, IL
Send a message via AIM to NewbieNerd
Quote:
Originally Posted by larswik
Can Java execute Unix functions? so in Java I can have it call up those functions that I use in the terminal within Java?

-Lars
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.
NewbieNerd is offline   0 Reply With Quote
Old Sep 9, 2006, 02:18 AM   #9
larswik
Thread Starter
macrumors 65816
 
Join Date: Sep 2006
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
larswik is offline   0 Reply With Quote
Old Sep 9, 2006, 06:52 AM   #10
atmenterprises
macrumors regular
 
Join Date: Jan 2006
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.

Quote:
Originally Posted by larswik
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.
__________________
Download LetterFool in the App Store.
atmenterprises is offline   0 Reply With Quote
Old Sep 9, 2006, 12:07 PM   #11
larswik
Thread Starter
macrumors 65816
 
Join Date: Sep 2006
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
larswik is offline   0 Reply With Quote
Old Sep 9, 2006, 01:05 PM   #12
x704
macrumors regular
 
Join Date: Apr 2006
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.
__________________
You can fix anything with a screwdriver and a bigger hammer.
http://www.wneary.com/
x704 is offline   0 Reply With Quote
Old Sep 9, 2006, 04:32 PM   #13
larswik
Thread Starter
macrumors 65816
 
Join Date: Sep 2006
I'll look into those books.

-Lars
larswik is offline   0 Reply With Quote
Old Sep 9, 2006, 04:59 PM   #14
nutman
macrumors regular
 
Join Date: May 2006
im taking comp sci at school and we use jcreator.. cause its free.
nutman is offline   0 Reply With Quote
Old Sep 9, 2006, 06:33 PM   #15
larswik
Thread Starter
macrumors 65816
 
Join Date: Sep 2006
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
larswik is offline   0 Reply With Quote
Old Sep 9, 2006, 06:51 PM   #16
peterparker
macrumors regular
 
Join Date: Mar 2005
Location: Houston
Send a message via AIM to peterparker
Eclipse is arguably the most popular Java editor. After that, NetBeans, JBuilder, IntelliJ are some of the top Java editors.
__________________
Zen - flickr
peterparker is offline   0 Reply With Quote
Old Sep 10, 2006, 12:41 PM   #17
geomes
macrumors newbie
 
Join Date: Sep 2006
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.
geomes is offline   0 Reply With Quote
Old Sep 10, 2006, 03:40 PM   #18
richard4339
macrumors 6502a
 
richard4339's Avatar
 
Join Date: Sep 2006
Location: Illinois
At my school, we just use Textpad. No IDEs for us! Since my migration to Mac, though, I've started using Textmate.
richard4339 is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Java question brentg33 OS X Mavericks (10.9) 2 Jan 25, 2014 09:42 AM
Java question brentg33 Mac Applications and Mac App Store 4 Aug 5, 2013 04:59 PM
Chrome on OS X -- Java plugin / Java 7 vs Java 6 Issue booyahbooyah Mac Applications and Mac App Store 4 May 31, 2013 09:13 AM
Java SE 7 13 question brentg33 Mac Applications and Mac App Store 1 Feb 2, 2013 12:11 PM
Java question brentg33 Mac Applications and Mac App Store 1 Aug 28, 2012 06:45 PM

Forum Jump

All times are GMT -5. The time now is 12:49 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC