William Gibson Books    www.williamgibsonboard.com    www.williamgibsonboard.com  Hop To Forum Categories  Random Thoughts    Basic computer assistance required, please.
Page 1 ... 65 66 67 68 69 70 71 ... 102
Go
New
Find
Notify
Tools
Reply
  
-star Rating Rate It!  Login/Join 
Member
Picture of Meru
Yahoo IM
Posted Hide Post
 
Posts: 4363 | Location: Belgium, with Wanderer! Together, we are the crime-fighting duo, WANDERU! | Registered: September 30, 2005Reply With QuoteEdit or Delete MessageReport This Post
Member
Picture of electricdragon/ madevilbeats
AIM: Online Status For elektrikdrag0n
Posted Hide Post
So, I'm finding myself doing a lot of Java coding. Now, I took classes for Java about a year ago, when Java 5 (1.5) was out. Now they have Java 6 (1.6). I'm having a lot of trouble getting code from the books I have to build properly. These books naturally center around using the 1.5 code tricks.

I guess I'm asking if anyone can help figure out why the old code doesn't work. Shouldn't it be backwards compatible?


***************************************************
* MEB_Registered: 20122002
 
Posts: 3321 | Location: Austin, Tejas | Registered: May 02, 2005Reply With QuoteEdit or Delete MessageReport This Post
Member
Picture of ArkanGL
Online Status For 33024673
Posted Hide Post
It should be compatible.

Post some bits of code here, and I'll tell you more.


_____________________________
Albert's path is a strange and difficult one.
 
Posts: 19947 | Location: Republic of Heaven | Registered: March 10, 2003Reply With QuoteEdit or Delete MessageReport This Post
Member
Picture of Wanderer
Yahoo IM
Posted Hide Post
Ack, it's Java! Run to the hills!


david
----------------------------
"I shoot with my balls"
 
Posts: 9162 | Location: bigend's country, with Meru! | Registered: April 28, 2003Reply With QuoteEdit or Delete MessageReport This Post
Member
Picture of ArkanGL
Online Status For 33024673
Posted Hide Post
Java is goodly.
Java is at the heart of anything that's pure and beautiful.
Java brings food to the starving, and coffee to the sleepy.


_____________________________
Albert's path is a strange and difficult one.
 
Posts: 19947 | Location: Republic of Heaven | Registered: March 10, 2003Reply With QuoteEdit or Delete MessageReport This Post
Member
Picture of shake
Posted Hide Post
It should all be backwards compatible. Are you importing not standard packages that aren't in your classpath or something?
 
Posts: 3883 | Location: Mountain View,CA,USA | Registered: September 30, 2003Reply With QuoteEdit or Delete MessageReport This Post
gil
Member
Picture of gil
Posted Hide Post
quote:
old code doesn't work

What exactly do you mean by that? Does it compile OK? Examples, please.
 
Posts: 792 | Location: UK | Registered: May 27, 2003Reply With QuoteEdit or Delete MessageReport This Post
Member
Picture of electricdragon/ madevilbeats
AIM: Online Status For elektrikdrag0n
Posted Hide Post
for example, here is one of the books. You can click on Downloads and get the zip file with all the code for the book. The first chapter is building a window Aquarium with little fish image files that bounce around. When I create a project with the files (one source and 3 .gifs) straight from the site, which are just about exactly what you'd end up typing while following along with the book, my window shows up and the thing runs but all you see is the title bar, no frame or fish or anything. It compiles just fine IIRC.


***************************************************
* MEB_Registered: 20122002
 
Posts: 3321 | Location: Austin, Tejas | Registered: May 02, 2005Reply With QuoteEdit or Delete MessageReport This Post
Member
Picture of electricdragon/ madevilbeats
AIM: Online Status For elektrikdrag0n
Posted Hide Post
quote:
What exactly do you mean by that? Does it compile OK? Examples, please.

quote:
It should all be backwards compatible. Are you importing not standard packages that aren't in your classpath or something?

Doubtful, I am usually using awt and swing and they seem to function correctly. Most of these things are simple code examples and 90% of them behave fine. It's a few like the Aquarium example above that do weird things.

One thing I noticed is trouble usually lies with using the GUI stuff. I was helping a student build a program for class and we had a simple task of adding a button to an already existing program. Everything was working fine until that point. After adding in the new button, it would never show up. Basically we were following the form of an example in his book which built a small JFrame with two buttons inside and there seemed to be no reason it wouldn't do the same thing on our computers. I would post that code up but after I had him email it to me it seemed he changed the code because none of the buttons show up! Very strange.


***************************************************
* MEB_Registered: 20122002
 
Posts: 3321 | Location: Austin, Tejas | Registered: May 02, 2005Reply With QuoteEdit or Delete MessageReport This Post
gil
Member
Picture of gil
Posted Hide Post
quote:
trouble usually lies with using the GUI stuff

It was ever thus, but usually it's just screen real estate problems, not a lack of existence. Could some of the stuff be stuck behind a layer which is the layer you're seeing?
 
Posts: 792 | Location: UK | Registered: May 27, 2003Reply With QuoteEdit or Delete MessageReport This Post
Member
Picture of Newro
Posted Hide Post
quote:
Originally posted by electricdragon/ madevilbeats:
for example, here is one of the books. You can click on Downloads and get the zip file with all the code for the book. The first chapter is building a window Aquarium with little fish image files that bounce around. When I create a project with the files (one source and 3 .gifs) straight from the site, which are just about exactly what you'd end up typing while following along with the book, my window shows up and the thing runs but all you see is the title bar, no frame or fish or anything. It compiles just fine IIRC.


Have no proper swing dev environment right now.

Problem could be a missing redraw, repaint ... what ever it is called. And a delay of a few milliseconds (like 5) afterwards might be able to fix it.



___________________________________________________________
"The best way to predict the future is to invent it." Alan Kay, 1971.
 
Posts: 4306 | Location: Cyberspace | Registered: January 09, 2004Reply With QuoteEdit or Delete MessageReport This Post
Member
Picture of electricdragon/ madevilbeats
AIM: Online Status For elektrikdrag0n
Posted Hide Post
I'm just using the latest NetBeans package for my IDE, sometimes testing in Eclipse as well. Both are free downloads.

I think the example I linked to, from the first chapter, uses AWT only, no Swing. What happens is the menu/title bar gets created, but nothing else. Just that bar.

I wonder if anyone is dling it and getting it to work?


***************************************************
* MEB_Registered: 20122002
 
Posts: 3321 | Location: Austin, Tejas | Registered: May 02, 2005Reply With QuoteEdit or Delete MessageReport This Post
Member
Picture of heavyboots
Posted Hide Post
What platform are you running on too? I happen to know that at least one Java developer is hugely pissed at Apple right now, claiming that their Java implementation is so broken he can't get work done (well, work in Leopard at least).
 
Posts: 4697 | Registered: January 14, 2003Reply With QuoteEdit or Delete MessageReport This Post
Member
Picture of electricdragon/ madevilbeats
AIM: Online Status For elektrikdrag0n
Posted Hide Post
I'm usually running in Windows XP Tablet Edition. I also have OSX 10.4.9 on this machine (with pen input functional!) but don't use it for anything but bragging rights. I also have OSX 10.4.9 running on my old Powerbook; I don't think I have Netbeans updated on it yet so I may try the program on that machine just to see that it works but I can't fathom how doing so would explain what was wrong with this machine's ability to implement the code....


***************************************************
* MEB_Registered: 20122002
 
Posts: 3321 | Location: Austin, Tejas | Registered: May 02, 2005Reply With QuoteEdit or Delete MessageReport This Post
gil
Member
Picture of gil
Posted Hide Post
I must confess that I haven't given this much time, but using JBuilder9 and jdk1.4 on XP, it chokes on line 15 of aquarium.java:

Vector <Fish> fishes = new Vector<Fish>();

"Aquarium.java": <identifier> expected at line 15, column 11

This message has been edited. Last edited by: gil,
 
Posts: 792 | Location: UK | Registered: May 27, 2003Reply With QuoteEdit or Delete MessageReport This Post
Member
Picture of ArkanGL
Online Status For 33024673
Posted Hide Post
I believe typed containers (like Vector) weren't introduced until 1.5

Gil, that's probably the cause of your error, and not EDs.


_____________________________
Albert's path is a strange and difficult one.
 
Posts: 19947 | Location: Republic of Heaven | Registered: March 10, 2003Reply With QuoteEdit or Delete MessageReport This Post
gil
Member
Picture of gil
Posted Hide Post
Oh, dear, I am behind the times. I was quite happy with Java without typed containers.
 
Posts: 792 | Location: UK | Registered: May 27, 2003Reply With QuoteEdit or Delete MessageReport This Post
Member
Picture of ArkanGL
Online Status For 33024673
Posted Hide Post
Typed containers are quite cool, though :
No need for casting anything anymore.
No way to get confused with the type of object an array or a vector will return.

Well... except when explicitly manipulating generic types.
Then, typing becomes a chore and an incomprehensible plain in the anus.


_____________________________
Albert's path is a strange and difficult one.
 
Posts: 19947 | Location: Republic of Heaven | Registered: March 10, 2003Reply With QuoteEdit or Delete MessageReport This Post
Member
Picture of electricdragon/ madevilbeats
AIM: Online Status For elektrikdrag0n
Posted Hide Post
yeah, sorry Gil, didn't think abnyone would still be using 1.4, there is actually a caveat in the book for the vector stuff:

Vector fishes = new Vector();

should be used instead.


***************************************************
* MEB_Registered: 20122002
 
Posts: 3321 | Location: Austin, Tejas | Registered: May 02, 2005Reply With QuoteEdit or Delete MessageReport This Post
gil
Member
Picture of gil
Posted Hide Post
quote:
(from ED) didn't think anyone would still be using 1.4
Huh, 1.4 feels really up to date where I sit. I did most of my Java development years ago on 1.1, and I daily use a Whitesmith's C compiler (vintage nineteen eighty mumble) on a VAX. Cool
 
Posts: 792 | Location: UK | Registered: May 27, 2003Reply With QuoteEdit or Delete MessageReport This Post
 Previous Topic | Next Topic powered by eve community Page 1 ... 65 66 67 68 69 70 71 ... 102 
 

William Gibson Books    www.williamgibsonboard.com    www.williamgibsonboard.com  Hop To Forum Categories  Random Thoughts    Basic computer assistance required, please.

© Copyright 2005, AuthorsOnTheWeb.com