Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / June 2006

Tip: Looking for answers? Try searching our database.

2 newbie questions

Thread view: 
CC - 22 Jun 2006 04:16 GMT
Hi there,

I'm quite new to Java, but I'm gonna stick to it in the future. When I
was having fun with Java, I met 2 problems:

1, GUI programmin is a little boring, is there an easy and neat GUI
designer for Java? It generates Java code when I drag component to the
Java frame.
2, When I compile a java program, i got the error message:
org.w3c.tidy does not exist.

is it something I missed and need to install? or I need to tell the
some compiler more parameters?

Thanks in advance.
CC
pradhip - 22 Jun 2006 05:40 GMT
Hi CC,

I would say if u r a newbie, just write java codes urself.. so that u
can get a better knowledge of whats happening inside..

otherwise u could go for Eclipse, JBuilder etc..

For the second one, u have used some outer class files. U have to
specify the jar file from which u r using the class file.

u r using some class file from org.w3c.tidy.. so it needs that..

U can set the jar file in the classpath.. then the compiler will know
that class files comes from that jar file...

Bye,

Pradhip

> Hi there,
>
[quoted text clipped - 12 lines]
> Thanks in advance.
> CC
Mark Space - 22 Jun 2006 06:27 GMT
> 1, GUI programmin is a little boring, is there an easy and neat GUI
> designer for Java? It generates Java code when I drag component to the
> Java frame.

Netbeans!

http://netbeans.org

> 2, When I compile a java program, i got the error message:
>  org.w3c.tidy does not exist.

Well, I don't know what this is, but yes you are either mis-naming
something, or you don't have your CLASSPATH or your PATH variable set
correctly.  There should be an import of org.w3c somewhere, or some use
of the class tidy.  It should be in the code you are compiling.  Are you
using a library or existing code?
adrien.rivard@laposte.net - 22 Jun 2006 13:45 GMT
Mark Space a écrit :

> > 1, GUI programmin is a little boring, is there an easy and neat GUI
> > designer for Java? It generates Java code when I drag component to the
[quoted text clipped - 3 lines]
>
> http://netbeans.org

Eclipse with visual editor plugin !

http://www.eclipse.org/vep/WebContent/main.php
Mark Space - 22 Jun 2006 16:51 GMT
> Mark Space a écrit :
>
[quoted text clipped - 5 lines]
>
> http://www.eclipse.org/vep/WebContent/main.php

I realize that we are verging on religious wars here of the Vim vs Emacs
variety, but as a newbie I found Netbeans easier to learn than Eclispe.
 Eclispe seems to have a lot of nice features, but the latest (5.0)
Netbeans is certainly not lacking, and the gui editor is built in.  All
in all a very easy start for the neophyte.

P. S. Vim is better.  *runs*
Frank van Schie - 25 Jun 2006 14:10 GMT
>> Mark Space a écrit :
>>
[quoted text clipped - 11 lines]
> Netbeans is certainly not lacking, and the gui editor is built in.  All
> in all a very easy start for the neophyte.

Once you know a bit about Java, and how Java structures code, I'd say
Eclipse is better. If only because of its sub-minute startup time.

However, for a project I'm working on now it's unusable due to a bug
with generics and the way I wanted to use them. I have a generic
interface which returns a value from an enum. However, the actual
contents of the enum is determined only at the various implementations.

So I have the following method declaration in the generic object:
   public <T extends Enum<T>> T getState();
And the implementation reads (with an enum StateEnum declared above):
   public StateEnum getState() {}

Eclipse won't compile this, while Netbeans has no problem with it, so I
just moved back to Netbeans. I found this odd, because at the end of the
day it's still the same Java compiler that has to allow this. I did
prefer Eclipse, though.

> P. S. Vim is better.  *runs*

Well, yes.
Signature

Frank

Oliver Wong - 29 Jun 2006 22:27 GMT
> Once you know a bit about Java, and how Java structures code, I'd say
> Eclipse is better. If only because of its sub-minute startup time.
[quoted text clipped - 13 lines]
> day it's still the same Java compiler that has to allow this. I did prefer
> Eclipse, though.

   Eclipse uses its own compiler to allow, for example, compilation of code
with syntax errors. Notice how if you try to run code with errors, it'll
notify you and ask if you want to "run anyway".

   - Oliver
Frank van Schie - 30 Jun 2006 00:58 GMT
>> So I have the following method declaration in the generic object:
>>    public <T extends Enum<T>> T getState();
[quoted text clipped - 9 lines]
> code with syntax errors. Notice how if you try to run code with errors,
> it'll notify you and ask if you want to "run anyway".

Okay, that explains a lot. Interesting feature, that. I guess it'd be
helpful when you know you're not going to be using the non-functional
code, in component testing for example.

I'll find some place to submit a bug report then; it fails to parse
valid Java.
Signature

Frank

CC - 23 Jun 2006 07:18 GMT
> Well, I don't know what this is, but yes you are either mis-naming
> something, or you don't have your CLASSPATH or your PATH variable set
> correctly.  There should be an import of org.w3c somewhere, or some use
> of the class tidy.  It should be in the code you are compiling.  Are you
> using a library or existing code?

I'm using an existing code. I've no clue whether I have org.w3c library
in my pc while I didn't see correct CLASSPATH, or I dont have the
library at all.

It seems like org.w3c is a kinda of standard library, but I dont know
where it should be in my system.

So this leads to another newbie question: where does Java store the
library/API in the system? i.e. java.*, javax.*, org.*, com.* ?

Thanks,
CC
Ian Wilson - 23 Jun 2006 15:40 GMT
>>Well, I don't know what this is, but yes you are either mis-naming
>>something, or you don't have your CLASSPATH or your PATH variable set
[quoted text clipped - 5 lines]
> in my pc while I didn't see correct CLASSPATH, or I dont have the
> library at all.

Hard to tell unless you reveal your classpath.

> It seems like org.w3c is a kinda of standard library, but I dont know
> where it should be in my system.

It isn't "standard" in the sense of being included with the Sun Java
Runtime Environment.

org.w3c.tidy appears to be part of an HTML parsing toolkit which is part
of the Jtidy application http://sourceforge.net/projects/jtidy/

> So this leads to another newbie question: where does Java store the
> library/API in the system? i.e. java.*, javax.*, org.*, com.* ?

AFAIK java.* and javax.* are in in rt.jar in the lib subfolder of your
JRE folder.
http://java.sun.com/j2se/1.4.2/docs/tooldocs/linux/jdkfiles.html

org.* and com.* are high level names that wouldn't have code associated
with them. You might have a jar file that contains classes in a
com.acme.* package and another separate jar file that contains classes
in a com.borland.* package. Both these are commercial organisations
(hence com.) but they are entirely separate companies and so there isn't
a single place (jar file) where you mix together their software.

The various jar files can, in principle, be anywhere in a file system
accessible to your computer. They have to be listed in the classpath so
the java runtime can find the classes in them.

http://java.sun.com/j2se/1.4.2/docs/tooldocs/findingclasses.html
CC - 23 Jun 2006 20:41 GMT
Thanks so much. For my simple problem, I think I need to get those .jar
files, put it into my harddisk, set CLASSPATH correctly, and it will
work.

So, if one person compiled his java program with 'extra' libraries, in
order to use it, other ppl have to have those libraries in the system
too, is this correct? I heard that Java is an easily-portable language,
so, it'll be a problem if the program is getting bigger, and using more
and more 'extra' libraries. In this case, what is the strategy to
distribute Java program? Should I put all the 'extra' libraries into a
.jar file, and distribute with my own Java class?

Thanks,
CC

> >>Well, I don't know what this is, but yes you are either mis-naming
> >>something, or you don't have your CLASSPATH or your PATH variable set
[quoted text clipped - 13 lines]
> It isn't "standard" in the sense of being included with the Sun Java
> Runtime Environment.

> > So this leads to another newbie question: where does Java store the
> > library/API in the system? i.e. java.*, javax.*, org.*, com.* ?
[quoted text clipped - 15 lines]
>
> http://java.sun.com/j2se/1.4.2/docs/tooldocs/findingclasses.html


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.