Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (538)
Games in Android Showcase (132)
games submitted by our members
Games in WIP (601)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Will this be possible in future versions of Java?  (Read 2734 times)
0 Members and 1 Guest are viewing this topic.
Offline K.I.L.E.R

Senior Devvie




Java games rock!


« Posted 2004-01-01 06:32:41 »

Being able to import the libraries in the main program file and they will be loaded for the entire project rather than having to import the same libraries for every file that needs to use them.

IE: I have 2 files, both require the Swing library and currently I have to import the Swing library in both files. Wouldn't it be easier if I could just loaded up in 1 file where the main method is and be done with importing libraries throughout the rest of the project?

Vorax:
Is there a name for a "redneck" programmer?

Jeff:
Unemployed. Wink
Offline Herkules

Senior Devvie




Friendly fire isn't friendly!


« Reply #1 - Posted 2004-01-01 14:02:19 »

Importing and loading is not the same thing!

Normally a lib is loaded only once when first used, regardless how many files to import it.

So don't wait for future Java versions.... even the oldest onces will be sufficient.

HARDCODE    --     DRTS/FlyingGuns/JPilot/JXInput  --    skype me: joerg.plewe
Offline cfmdobbie

Senior Devvie


Medals: 1


Who, me?


« Reply #2 - Posted 2004-01-01 15:31:59 »

Yeah, you're not importing a library with the "import" keyword, you're allowing the use of shortened names from that package.  The "import" command is just there to make your life easier, otherwise you'd be writing "java.lang.String = new java.lang.String();" etc.

Hellomynameis Charlie Dobbie.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline kevglass

« JGO Spiffy Duke »


Medals: 212
Projects: 24
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #3 - Posted 2004-01-01 15:36:53 »

I think what KILER was getting at was being able to stick a bunch of imports in one file then just include this file in each in someway.

EDIT: Just clarifying, not agreeing or disagreeing.

Kev

Offline gregorypierce

Senior Devvie




I come upon thee like the blue screen of death....


« Reply #4 - Posted 2004-01-01 16:33:20 »

If he is, I hope not Smiley

http://www.gregorypierce.com

She builds, she builds oh man
When she links, she links I go crazy
Cause she looks like good code but she's really a hack
I think I'll run upstairs and grab a snack!
Offline morbo

Senior Newbie





« Reply #5 - Posted 2004-01-01 20:09:55 »

Or, rather than making changes to the language, you could use an IDE that manages imports for you. Using Eclipse, for example, I rarely even think about imports anymore (one keystroke adds imports automatically, all I have to do is resolve ambiguities).
Offline K.I.L.E.R

Senior Devvie




Java games rock!


« Reply #6 - Posted 2004-01-05 22:22:47 »

Thanks.
Yes I am talking about never having to worry about imports again.

I should get Eclipse, I used Eclipse before but I prefer JCreator.

Vorax:
Is there a name for a "redneck" programmer?

Jeff:
Unemployed. Wink
Offline erikd

JGO Ninja


Medals: 16
Projects: 4
Exp: 14 years


Maximumisness


« Reply #7 - Posted 2004-01-06 18:13:42 »

I think this is really a bad idea.

Offline K.I.L.E.R

Senior Devvie




Java games rock!


« Reply #8 - Posted 2004-01-07 00:27:49 »

Quote
I think this is really a bad idea.


Why do you believe that?

Another question, I have installed Eclipse 3.0 M6 and I like it much better than JCreator (I didn't like Eclipse 2.1 for some reason) and when I organise imports it doesn't do "import javax.swing.*;" instead it "import javax.swing.JFrame;" is there a performance improvement or smaller memory footprint for the program if you import only what you specifically need?

Thanks

Vorax:
Is there a name for a "redneck" programmer?

Jeff:
Unemployed. Wink
8: Undefined index: online
File: /home/jgo/public_html/Themes/default/Display.template.php (main sub template - eval?)
Line: 161