Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (522)
Games in Android Showcase (127)
games submitted by our members
Games in WIP (590)
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  
  Question of Basic Esthetics  (Read 1521 times)
0 Members and 1 Guest are viewing this topic.
Offline damollitor

Senior Newbie




Java games rock!


« Posted 2005-02-12 14:21:28 »

Sorry, I'm not sure where else to post this...


What's better style/efficiency?

import javax.swing.*;

or....

import javax.swing.JFrame;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.JScrollPane;
import javax.swing.JPanel;
Offline Catharsis

JGO Coder


Medals: 16
Projects: 1
Exp: 18 years


TyphonRT rocks!


« Reply #1 - Posted 2005-02-12 17:13:24 »

My understanding is that efficiency is not a concern as it is just a matter of package scope that you are giving your class. In general for style I use the all inclusive *after importing 2 classes from a package if there isn't a reason to do otherwise.    There could be reasons to import single classes if the package is a little convoluted I suppose.

Please support my Kickstarter for next-gen video apps for Android:
http://kck.st/1xA3R61

Founder & Principal Architect; TyphonRT, Inc.
http://www.typhonrt.org/
http://www.egrsoftware.com/
https://plus.google.com/u/0/+MichaelLeahy/
Offline Breakfast

Senior Devvie




for great justice!


« Reply #2 - Posted 2005-02-12 17:49:09 »

My understanding is that when your classes are compiled they only import the stuff you use anyways, so I don't think it really matters unless you want to remember what exactly you are doing in the current class...
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline damollitor

Senior Newbie




Java games rock!


« Reply #3 - Posted 2005-02-12 19:07:13 »

Great,

Thanks for the info!

Another question.  Is there a JRE 1.5 for macs?
Offline jbanes

JGO Coder


Projects: 1


"Java Games? Incredible! Mr. Incredible, that is!"


« Reply #4 - Posted 2005-02-12 21:40:25 »

FWIW, imports are not actually instructions. All they are is a bit of syntactical sugar that the compiler recognizes so that programmers don't have to type stuff like "java.lang.String". Many users with a C/C++ background (*cough*especially the GNU and their lawyers*cough*) fail to understand this simple point because they are used to the way includes work.

Quote
Another question.  Is there a JRE 1.5 for macs?


OS X 10.4, due out any day now. (It's in beta right now.) No word on whether Apple will do a port for previous OS X versions.

Java Game Console Project
Last Journal Entry: 12/17/04
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

trollwarrior1 (34 views)
2014-11-22 12:13:56

xFryIx (73 views)
2014-11-13 12:34:49

digdugdiggy (52 views)
2014-11-12 21:11:50

digdugdiggy (46 views)
2014-11-12 21:10:15

digdugdiggy (40 views)
2014-11-12 21:09:33

kovacsa (66 views)
2014-11-07 19:57:14

TehJavaDev (70 views)
2014-11-03 22:04:50

BurntPizza (68 views)
2014-11-03 18:54:52

moogie (83 views)
2014-11-03 06:22:04

CopyableCougar4 (82 views)
2014-11-01 23:36:41
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!