[4289] in java-interest
java-interest-digest V1 #269
daemon@ATHENA.MIT.EDU (java.sun.com!owner-java-interest-d)
Fri Dec 15 14:09:44 1995
From: java.sun.com!owner-java-interest-digest@asoft.msk.su
Date: Mon, 20 Nov 1995 11:01:14 -0800
To: java-interest-digest@java.sun.com
Reply-To: java.sun.com!java-interest@asoft.msk.su
java-interest-digest Monday, 20 November 1995 Volume 01 : Number 269
In this issue:
POST method for HTTP URLs?
AWT deficiencies ?
Re: Colors of an Image
Java for CAD like UI
re:Dynamic Object Instantiation ....
Re: Building a distributed application in Java
Awt.Component, paint and update in Beta1
Java usage from Netscape 2.0
Programmers' Java text book
Re: Rule subsystem
Latest J*** Notes delayed
Instanciation by name
Re: Rule subsystem
Java good for us?
Re: Awt.Component, paint and update in Beta1
error in sample code ...
[Q] Disable Appletviewer's Copyright Message ?
huh?
RFC "Off the Web Java"
Re: Socket Problem (new)
Re: Dynamic Object Instantiation ....
linking java with c/c++
----------------------------------------------------------------------
From: "James E. Kittock" <kittock@interval.com>
Date: Fri, 17 Nov 1995 16:44:35 -0700
Subject: POST method for HTTP URLs?
Ok, here's another missing piece: being
able to POST to an HTTP url.
I see that this existed in the old HotJava
code, but it is apparently missing from
the JDK stuff.
I guess I can write my own stream handler, instantiate
my own stream handler factory, and go from there.
Sigh.
If Java is supposed to be the programming language
for the Internet & Web, why was all of that functionality
stripped from the JDK!?!
- --james
- --
James E. Kittock --- Interval Research Corporation
1801-C Page Mill Road, Palo Alto, California 94304
kittock@interval.com (415)842-6185
------------------------------
From: Bob Beck <rbk@ibeam.jf.intel.com>
Date: Fri, 17 Nov 95 17:35 PST
Subject: AWT deficiencies ?
I've finally got around to working with AWT (this is with Java Beta1 on
WinNT). I've noticed a few things, was curious if I'm missing something or
if these issues will be addressed in a future version:
It doesn't look like one can tab between fields (at least, not they way I've
tried it).
There doesn't seem to be a way to create keyboard accelerators.
There doesn't seem to be a way to "check" and "uncheck" menu items (they can
be enabled/disabled, though).
MenuBar's in Frame's aren't cleanly (visually) separated from the contents
of the window (ie, no clean seperating line).
Frame.setHelpMenu() doesn't seem to work - the menu isn't displayed.
Help, pointers, confirmation, rebuttals all accepted ;-)
- --
Bob Beck rbk@ibeam.intel.com CompuServe: 71674,106
Intel Corporation (503)264-8856 AOL: RDBeck
------------------------------
From: flar@bendenweyr.Eng.Sun.COM (Jim Graham)
Date: Fri, 17 Nov 1995 17:46:09 -0800
Subject: Re: Colors of an Image
- ----------
X-Sun-Data-Type: text
X-Sun-Data-Description: text
X-Sun-Data-Name: text
X-Sun-Charset: us-ascii
X-Sun-Content-Lines: 17
> How can I find the red, green, and red values for a pixel in an
> Image?
Get its ImageProducer using Image.getSource() and then register yourself
as an ImageConsumer using starProduction() and save the pixel values as
they are delivered in the setPixels() interface method. Attached is a
utility class to do this:
int[] buffer = new int[w*h];
PixelGrabber pg = new PixelGrabber(image, x, y, w, h,
buffer, 0, w);
pg.grabPixels();
// Now buffer[j * w + i] will contain the ARGB values
// for pixel (x+i, y+j) in the image.
...jim
- ----------
X-Sun-Data-Type: default
X-Sun-Data-Description: default
X-Sun-Data-Name: PixelGrabber.java
X-Sun-Charset: us-ascii
X-Sun-Content-Lines: 176
import java.util.Hashtable;
import java.awt.image.ImageProducer;
import java.awt.image.ImageConsumer;
import java.awt.image.ColorModel;
import java.awt.Image;
public class PixelGrabber implements ImageConsumer {
ImageProducer producer;
int dstX;
int dstY;
int dstW;
int dstH;
int[] pixelbuf;
int dstOff;
int dstScan;
private boolean grabbing;
private boolean grabbed;
public PixelGrabber(Image img, int x, int y, int w, int h,
int[] pix, int off, int scansize) {
this(img.getSource(), x, y, w, h, pix, off, scansize);
}
public PixelGrabber(ImageProducer ip, int x, int y, int w, int h,
int[] pix, int off, int scansize) {
producer = ip;
dstX = x;
dstY = y;
dstW = w;
dstH = h;
dstOff = off;
dstScan = scansize;
pixelbuf = pix;
}
public void grabPixels() throws InterruptedException {
grabPixels(0);
}
public synchronized boolean grabPixels(long ms)
throws InterruptedException
{
long end = ms + System.currentTimeMillis();
if (!grabbing) {
producer.startProduction(this);
grabbing = true;
}
while (!grabbed) {
long timeout;
if (ms == 0) {
timeout = 0;
} else {
timeout = end - System.currentTimeMillis();
if (timeout <= 0) {
break;
}
}
wait(timeout);
}
return grabbed;
}
public void setDimensions(int width, int height) {
return;
}
public void setHints(int hints) {
return;
}
public void setProperties(Hashtable props) {
return;
}
public void setColorModel(ColorModel model) {
return;
}
public void setPixels(int srcX, int srcY, int srcW, int srcH,
ColorModel model,
byte pixels[], int srcOff, int srcScan) {
if (srcY < dstY) {
int diff = dstY - srcY;
if (diff >= srcH) {
return;
}
srcOff += srcScan * diff;
srcY += diff;
srcH -= diff;
}
if (srcY + srcH > dstY + dstH) {
srcH = (dstY + dstH) - srcY;
if (srcH <= 0) {
return;
}
}
if (srcX < dstX) {
int diff = dstX - srcX;
if (diff >= srcW) {
return;
}
srcOff += diff;
srcX += diff;
srcW -= diff;
}
if (srcX + srcW > dstX + dstW) {
srcW = (dstX + dstW) - srcX;
if (srcW <= 0) {
return;
}
}
int dstPtr = dstOff + (srcY - dstY) * dstScan + (srcX - dstX);
int dstRem = dstScan - dstW;
int srcRem = srcScan - srcW;
for (int h = srcH; h > 0; h--) {
for (int w = srcW; w > 0; w--) {
pixelbuf[dstPtr++] = model.getRGB(pixels[srcOff++] & 0xff);
}
srcOff += srcRem;
dstPtr += dstRem;
}
}
public void setPixels(int srcX, int srcY, int srcW, int srcH,
ColorModel model,
int pixels[], int srcOff, int srcScan) {
if (srcY < dstY) {
int diff = dstY - srcY;
if (diff >= srcH) {
return;
}
srcOff += srcScan * diff;
srcY += diff;
srcH -= diff;
}
if (srcY + srcH > dstY + dstH) {
srcH = (dstY + dstH) - srcY;
if (srcH <= 0) {
return;
}
}
if (srcX < dstX) {
int diff = dstX - srcX;
if (diff >= srcW) {
return;
}
srcOff += diff;
srcX += diff;
srcW -= diff;
}
if (srcX + srcW > dstX + dstW) {
srcW = (dstX + dstW) - srcX;
if (srcW <= 0) {
return;
}
}
int dstPtr = dstOff + (srcY - dstY) * dstScan + (srcX - dstX);
int dstRem = dstScan - dstW;
int srcRem = srcScan - srcW;
for (int h = srcH; h > 0; h--) {
for (int w = srcW; w > 0; w--) {
pixelbuf[dstPtr++] = model.getRGB(pixels[srcOff++]);
}
srcOff += srcRem;
dstPtr += dstRem;
}
}
public synchronized void imageComplete(int flags) {
grabbed = true;
notifyAll();
}
}
------------------------------
From: rafael@pse.res.titech.ac.jp (Batres)
Date: Sat, 18 Nov 1995 11:50:50 +0900
Subject: Java for CAD like UI
Hi Java comunity,
I am analyzing the possibility to use java for a CAD like user interface
in which the user could choose objects from a menu and linked them
together. Every object should have attributes already defined in the
program but other attributes should be input from the user, so new
instances should be created and then we need to think the way to save
this instances in a object oriented database. Is it possible to create
instances in java on the fly? Is it possible to develop such a system?
Does anyone has answer for this?
Thanks
R. Batres
------------------------------
From: "andrew (a.) francis" <andrewfr@bnr.ca>
Date: Fri, 17 Nov 1995 10:01:00 -0500
Subject: re:Dynamic Object Instantiation ....
In message "Dynamic Object Instantiation ....", you write:
> I load a new class by a given name from a directory.
> Afterwards I instantiate a new Object that way:
> Object newObject = Class.forName("...")
>
> Everything works fine until the moment I try to call a method of this new
> object. I do have the problem, that the Class object does not provide the
> called method, e.g.:
> newObject.getOID();
>
> How can I instantiate the object with the right cast???
What you could do is have your object implement an interface, say
Dummy, that declares the methods that your class implements. For
example:
public interface Dummy
{
public void Print();
}
and
public class MyClass implements Dummy
{
.
.
.
Once you have loaded your class (by whatever means), instantiate
it,
Object x = myClass.newInstance();
And then cast using the interface, to activate methods, i.e
( (Dummy) x).Print();
This was the approach recommended to be used to handle classes that
come from a custom classloader.
Cheers,
Andrew
------------------------------
From: cybercafe@easynet.co.uk (Cyberia10 (London))
Date: Sat, 18 Nov 1995 14:46:10 GMT
Subject: Re: Building a distributed application in Java
At 17:05 17/11/95 -0600, David Boone wrote:
>try
>
>http://www.is.com/Demos/JavaDemos/homePage.html
>-
>This message was sent to the java-interest mailing list
>Info: send 'help' to java-interest-request@java.sun.com
>
>
"evolution is the acceleration of
perception"
------------------------------
From: michel@mmania.com (michel meyer)
Date: Sat, 18 Nov 1995 17:07:33 -0100
Subject: Awt.Component, paint and update in Beta1
Hi folks,
I'm having a little problem with the paint and update method of an
awt.Component: the basic idea is that I want an "invisible" component.=20
No, this is not as stupid as it may seem, I just want to take advantage of
the mouseEnter, mouseDown, ... methods without having any noticeable object
on screen.
So I thought that it should be easy to derive a testCanvas class from
awt.Canvas, and overide paint and update as empty methods.
However, it appears that "some other objects ..." are still erazing the
testCanvas' position with the backgroundColor of the testCanvas object.
In the src/java/awt/Component.java file, there's a comment next to the
update method which says: "you can assume that the background has not been
erazed" ... It does not seem to be right...
Here's some sample code:
// the testCanvas class
import java.awt.*;
class testCanvas extends Canvas {
testCanvas () {
setBackground(Color.pink);
resize(50,50);
}
public void paint(Graphics g) {
}
public void update(Graphics g) {
}
}
// the testApplet class
import java.applet.Applet;
import testCanvas;
public class testApplet extends Applet {
public void init() {
add(new testCanvas());
}
=20
}
// a test html files
<HEAD>
<TITLE> Test Applet</TITLE>
</HEAD>
<BODY>
<br>
<APPLET CODE=3D"testApplet.class" WIDTH=3D200 HEIGHT=3D100>
</APPLET>
</BODY>
Does anybody have an idea of who is drawing that #=A4#%=B5! pink square !!!
Any help would be welcome !!!
thanks for your time
Michel (michel@mmania.com)
##############################
# MultiMania Production #
# 1.rue de Paradis #
# 75010 Paris #
# Tel: 45-23-08-19 #
# E-mail: info@mmania.com #
##############################
------------------------------
From: enrique@foozy.sun.com (Enrique D Espinosa)
Date: Sat, 18 Nov 1995 11:47:47 +0600
Subject: Java usage from Netscape 2.0
Hi there:
This is a call for help on the following: My applets won't show on
Netscape, probably due to a misconception on my part when installing
Netscape 2.0 beta. I am compiling with the Beta JDK.
Take, as an example, the following case:
$ ls
Codification.class Codification.java TestApplet.html
$ /usr/java/java/java/bin/appletviewer TestApplet.html
Zip Error: /export/home/enrique/.netscape/moz2_0.car: Unable to locate end-of-central-directory record
Warning:
Cannot allocate colormap entry for default background
Warning: <applet> tag requires width attribute.
Warning: No Applets were started, make sure the input contains an <applet> tag.
use: appletviewer [-debug] url|file ...
My profile has a CLASSPATH = /export/home/enrique/.netscape/moz2_0.car
Netscape is installed on: /usr/openwin/bin/netscape2b
My question is: Do ALL classes (Java's and mine) have to be contained within
this file? is this an expandable library?
Thanks
- -----------------------------------------------------
*************** *************** ***************
|*************** *************** ***************
| **** **** **** **** ****
| **** **** **** **** ****
| ********* **** **** **** ****
| ********* **** **** **** ****
| **** **** **** **** ****
* **** **** **** **** ****
* **** **** **** **** ****
* **** **** **** **** ****
* **** *************** ***************
* **** *************** ***************
* .----------------------------------------------------.
* | MC Enrique David Espinosa | http:// |
* | Depto de Computacion | www.ccm.itesm.mx/ |
* | ITESM-CCM | ~enrique/ |
* | voice: (525)673-1000x4231 | EECDOCS/ |
*| fax: (525)673-2500 | Main.html |
`----------------------------------------------------'
------------------------------
From: Marko Gargenta <mgargent@undergrad.math.uwaterloo.ca>
Date: Sat, 18 Nov 1995 17:27:55 -0500 (EST)
Subject: Programmers' Java text book
What would in your oppinion be the best programmers' Java text around.
- ---------------------------
Marko Gargenta
University of Waterloo
Marko.Gargenta@uWaterloo.Ca
------------------------------
From: sdw@lig.net (Stephen D. Williams)
Date: Sat, 18 Nov 1995 23:43:51 -0500 (EST)
Subject: Re: Rule subsystem
The last version of CLIPS that I looked at didn't have real back-chaining.
I wrote a C++ forward/backward chaining set of classes with extensible
objects (id, relationship, value, 'arena'), etc. that you could write
rules directly in C++ for or have an application specific mini-language...
(4 years ago...)
Alas, GE Aircraft owns it, although they probably don't use it now.
Couldn't get the lawyers to complete the paperwork.
I'd be interested in anything anyone has along these lines and would be
interested in helping to extend it.
Pointers to source?
>
> Sounds good. Have you used CLIPS 6.0? I've been idly considering putting a
> native method wrapper around it.
>
> >Still a lot to be done. But I'm getting there.
> >
> >Ron
> >
> >---------------------------------------------------------------------
> >Ron van Hoof NYNEX Science & Technology, Inc.
> >Member of Technical Staff Research & Development
> > Work Systems Design Group
> >E-Mail: rvhoof@nynexst.com 400 Westchester Avenue, Rm 115a
> >Voice: (914) 644-2046 White Plains, NY 10604
> >Fax: (914) 949-9566 USA
> >---------------------------------------------------------------------
> >
>
> Do you know Sergio Canetti?
>
> cheers, bc
Thanks
sdw
- --
Stephen D. Williams 25Feb1965 VW,OH (FBI ID) sdw@lig.net http://www.lig.net/sdw
Consultant, Vienna,VA Mar95- 703-918-1491W 43392 Wayside Cir.,Ashburn, VA 22011
OO/Unix/Comm/NN ICBM/GPS: 39 02 37N, 77 29 16W home, 38 54 04N, 77 15 56W
Pres.:Concinnous Consulting,Inc.;SDW Systems;Local Internet Gateway Co.;28May95
------------------------------
From: mentor@io.org (David Forster)
Date: Sun, 19 Nov 1995 02:05:22 -0500
Subject: Latest J*** Notes delayed
My site is having difficulty with email for some reason (will you even see
this?), and therefore the latest issue of the J*** Notes will be delayed
until some time on Monday. We apologise for the delay.
Cheers,
David Forster <br><a href="http://www.io.org/~mentor">
Mentor Software Solutions </a><br>
+1 905 832 4837 <br>
------------------------------
From: michel@mmania.com (Michel MEYER)
Date: Sun, 19 Nov 1995 16:55:48 +0100
Subject: Instanciation by name
One can read in the JAVA Specification (4.6 Object Creation -- the new
Operator) that there is a form of the new operator which allows name
instanciation, by default calling the default constructor.
Here is what's written:
/-------- begin quote
A third form of allocator allows the class name to be provided as a String
expression. The String is
evaluated at runtime, and new returns an object of type Object, which must
be cast to the desired type.
b = new ( "Class"+"A" );
In this case, the constructor without arguments is called.
/-------- end quote
However, I tryed this and I got an error message at compile time:
test.java:7: 'new(...)' not supported.
add((A) new ("Class A"));
^
So, as I understand it this feature is not yet implemented. As we are now
already in beta, I am wondering if this will have any chance to be
implemented in future releases, or is it a dropped feature ?
Maybe I missed something ... in any case, I would appreciate any answer
Michel (michel@mmania.com)
########################################################
## The (virtual) Baguette: http://www.mmania.com ##
########################################################
------------------------------
From: rvhoof@nynexst.com (Ron van Hoof)
Date: Sun, 19 Nov 1995 13:30:58 -0500
Subject: Re: Rule subsystem
Hoi Stephen,
I just started the development of a backward chainer. My first
version only supprts the use of simple variables. I'm working on
extending it to object-attribute pairs. The problem that i have at
this moment is that my regular work is taking up all my time.
So in the last month I couldn't develop anything. I'll send you the code
that i have so far tomorrow.
THings to be done are:
- objects with attributes
- trace facilities (a first basic trace is already
built in)
- answering question like why and how.
- forward chainer (basic version first, next with
rete algorithm
- etc.
I still have a lot of stuff planned. I only need to try to
solve my time problem. We are having a deadline in December so I guess
after that I can continue my work on this.
Ron
- ---------------------------------------------------------------------
Ron van Hoof NYNEX Science & Technology, Inc.
Member of Technical Staff Research & Development
Work Systems Design Group
E-Mail: rvhoof@nynexst.com 400 Westchester Avenue, Rm 115a
Voice: (914) 644-2046 White Plains, NY 10604
Fax: (914) 949-9566 USA
- ---------------------------------------------------------------------
------------------------------
From: michael@w3media.com (Michael Mehrle)
Date: Sun, 19 Nov 1995 12:05:11 -0700
Subject: Java good for us?
>> by a factor 2-4 just by tweaks in the interpeter after the beta release.
>>
>> Of course what we are really waiting for is dynamic compilation to
>> native code. Java will then run just a hair slower than other compiled code.
>>
>> (Java is going to eat the world.)
> Java is neccessary. And I heard word that it will support
>Corba. Without JAva, the web is all the same.
> What's better, is that you need to be a programmer to write
>Java. Which will eliminate all those fools out there putting up
>garbage 0 content pages overnight.
>
>
Hi there!
You're totally right! We're a webdesign company and if it wasn't for more
sophisticated tools like Java that require (fortunately) more sophisticated
skills, I could close down my company tomorrow! I've been in the graphic
design business, for well, almost a decade, grew into "multimedia" and my
natural extension of my previous work was to become a web-designer (and it
took a while to get comfortable with the idea of hacking code!).
From my experiences with clients on two continents so far: I can tell you,
that most customers are a perfidious pack of schmucks who don't give a crap
about good design, storyboarding or a well human interaction interface, as
long as they can do it SOMEHOW themselves.
With Aldus' new drag-and-drop HTML tool in example, HTML will become the
Pagemaker of the web. Most smaller companies will do it themselves, trying
to save resources, having their little web account with some cheapo service
provider. Weird, although a lot of companies spend thousands in
advertising, they often insist of doing the design and copywriting
themselves.
More and more turn-key-solution from Microsoft, Aldus, Netscape etc. will
hit the market; so the only alternative for developers like you and me will
be to "specialize" in a variety of skill sets, that would be extremely hard
to attain in a short amount of time and a limited amount of I.Q. 8^),
hence programming and scripting is the key, to make a buck IMHO!
It is up to us to create the tools that will attract the market out there,
but at the same time will still keep us in business. With a more
sophisticated agenda on the web and an increasing demand for higher
bandwith, HTML will hopefully only remain the basic structure of a site,
whereas professional designed and highly visible sites will most definitely
include Quicktime and AVID movies, Java animations, RDBMS accessing, VRML,
etc, etc...
Believe me my fellow developers; Java, Perl, and other webrelated
development tools, are the only family we have left, now!
What's your opinion? Will Java change the Net for the better and provide
constant work for all of us? Or will Billy's and Aldus' turn-key-solutions
take over, raking in big time, leaving us in the dust??
Michael Mehrle
||||
o o
____________OOOo___<>___oOOO_______________
http://www.w3media.com/w3media
michael@w3media.com
Tel. 310.441.9599
Fax 310.441.5919
"One man's mundane and desperate existence
is someone else's Technicolor."
-Strange Days-
------------------------------
From: michel@mmania.com (michel meyer)
Date: Sun, 19 Nov 1995 22:01:28 -0100
Subject: Re: Awt.Component, paint and update in Beta1
>I think it;s your Applet that's doign it. Your canvas
>subclass isn't doing, but your Applet class is. I could
>be completely wrong about this. Try overriding paint and
>update in TestApplet or whatever you called it.
>
>
>
Ok, I thought of that and I tryed overiding paint and update of TestApplet.
class testCanvas extends Canvas {
testCanvas () {
setBackground(Color.pink);
resize(50,50);
}
public void paint(Graphics g) {
System.out.println("Canvas.paint");
}
public void update(Graphics g) {
System.out.println("Canvas.update");
}
}
But no dice, it doesn't change anything.
And I tryed under Solaris, NT and 95, could it be the peer which is drawing ?
Michel (michel@mmania.com)
####################################################
## The (virtual) Baguette: http://www.mmania.com ##
####################################################
##############################
# MultiMania Production #
# 1.rue de Paradis #
# 75010 Paris #
# Tel: 45-23-08-19 #
# E-mail: info@mmania.com #
##############################
------------------------------
From: michel@mmania.com (michel meyer)
Date: Sun, 19 Nov 1995 22:15:25 -0100
Subject: error in sample code ...
sorry, but there was a mistake in the sample code of my previous mail.
You might have corrected by yourself but justin case, here is the right one:
class testApplet extends Applet{
testApplet () {
setBackground(Color.pink);
resize(50,50);
}
public void paint(Graphics g) {
System.out.println("Applet.paint");
}
public void update(Graphics g) {
System.out.println("Applet.update");
}
}
Thanks for your time and your help
Michel (michel@mmania.com)
####################################################
## The (virtual) Baguette: http://www.mmania.com ##
####################################################
##############################
# MultiMania Production #
# 1.rue de Paradis #
# 75010 Paris #
# Tel: 45-23-08-19 #
# E-mail: info@mmania.com #
##############################
------------------------------
From: hcchoi@khgw.info.samsung.co.kr (Choi,Heechang)
Date: Mon, 20 Nov 1995 09:19:28 +0900
Subject: [Q] Disable Appletviewer's Copyright Message ?
Hi,
Everytime I run appletviewer, Copyright window appears.
Is there any method to disable this kind of thing?
Thanks in Advance!
- ----------------------------------------------------------------------------
- ------------
Choi, Heechang
Samsung Electronics., Ltd, Multimedia Lab. Network Group.
tel) 02-745-0084(ext.8444)
hcchoi@saitgw.sait.samsung.co.kr
http://net.info.samsung.co.kr/~hcchoi/
- ----------------------------------------------------------------------------
- ------------
------------------------------
From: ramkriss@cs.purdue.edu (Sriram Ramkrishna)
Date: Sun, 19 Nov 1995 21:16:35 -0500
Subject: huh?
You know looking at Java, it looks like a synthesis of C++ and Modula-3. What
are the similiarities? Does anybody know?
sri
------------------------------
From: AlanFrye@aol.com
Date: Mon, 20 Nov 1995 00:21:28 -0500
Subject: RFC "Off the Web Java"
I would like to issue a request for comments on current "off the Web" Java
development and thoughts on the future potential of Java as an application
development language (environment).
I noticed that the Beta 1 release seemed to be a refocus toward the original
Java goal - THE Internet development language. Since the Web is hot, this is
indeed an intelligent and really a much needed decision. However, I believe
the true strength of Java will actually lie in its internet (notice the lower
case "i") capabilities. The idea of a distributable, single source/rt
interpreted language running on various platforms is not new, but the Java
team has scratched the surface of what is really possible in the real-world
of grunt information system development.
I think Java has the potential to make a great tool (or, at least the basis)
for C/S develpment and whatever distributed architecture will follow. Anyone
who has worked a C/S system with 3, 4, or even more platforms using 2 or 3
different languages with a different compiler for each platform (ANSI seems
to popup a lot) interfacing native tools (also slightly different on each
platform) and etc., would truely appreciate what Java has to offer. I know
there are C/S tools that claim to over come and replace the archaic litany
of tools I just described, but I have yet to see one that truely delivers
(especially like Java could).
I realize that Java is still young, still maturing, intended primarily for
The Internet (as opposed to an internet), and from what I have seen, may be
used in its current incarnation to develop a private C/S system now, but full
application develpment capabilites are (in my opinion), yet to be fleshed out
(what about DB connectivity - do I have to implement that - I could - but in
the spirit of "language dependency", maybe...).
I understand the intent of Sun in Java. I am not issuing this as a
complaint. I only want to find out how far others have gotten, and how many
more may have the same interest in Java. Perhaps user supported application
libraries are the answer, or commercial libraries, or language dependencies -
I don't know, that's why I am writting this.
Thanks in advance...
------------------------------
From: garya@village.org (Gary Aitken)
Date: Mon, 20 Nov 1995 00:54:06 -0700
Subject: Re: Socket Problem (new)
>When I use the method getLocalPort from the SocketServer Class, I always
>get an compiling error saying that the method not found in class such as
>such. The JDK I am using is 1.0 beta.
>
>For example,
>
> ServerSocket Sock = new ServerSocket(0,100);
>
> Sock.getLocalPort();
It seems strange that the new ServerSocket would compile, but not
the reference to the method getLocalPort. The following compiles fine
for me:
import java.net.*;
public class SocketTest {
public static void main( String argv[] ) {
try {
ServerSocket Sock = new ServerSocket(0,100);
Sock.getLocalPort();
}
catch (java.io.IOException ex) {
}
};
}
Gary Aitken garya@village.org
------------------------------
From: garya@village.org (Gary Aitken)
Date: Mon, 20 Nov 1995 00:54:11 -0700
Subject: Re: Dynamic Object Instantiation ....
>I load a new class by a given name from a directory.
>Afterwards I instantiate a new Object that way:
>Object newObject = Class.forName("...")
>
>Everything works fine until the moment I try to call a method of this new
>object. I do have the problem, that the Class object does not provide the
>called method, e.g.:
>newObject.getOID();
>
>How can I instantiate the object with the right cast???
This isn't what you want; the above only gives you the class descriptor
for the type of object you want, not an object of that type.
To get an object of the proper type, you need to use the newInstance
method from the class description returned. You'll need to catch
all the relevant exceptions:
public class CloneTest {
public static void main( String argv[] ) {
Class cls; // Class description for desired class
String str; // new object
try {
cls = Class.forName( "java.lang.String" );
try {
str = (String) cls.newInstance();
System.out.println( str.length() );
System.out.println( str );
}
catch ( java.lang.IllegalAccessException ex) {
System.out.println( "IllegalAccessException" );
}
catch ( java.lang.InstantiationException ex) {
System.out.println( "InstantiationException" );
}
}
catch ( java.lang.ClassNotFoundException ex ) {
System.out.println( "Class not found" );
}
}
}
Gary Aitken garya@village.org
------------------------------
From: Marko Gargenta <mgargent@undergrad.math.uwaterloo.ca>
Date: Mon, 20 Nov 1995 10:26:10 -0500 (EST)
Subject: linking java with c/c++
I want to use Java for the new project, but I also need to use Lex/Yacc
for it too.
Is there any way to link c/c++ to Java somehow, or are the
tools like Lex/Yacc going to be designed for Java too?
Also, Java intrepreter has not been ported to linux yet, or has it?
- ---------------------------
Marko Gargenta
University of Waterloo
Marko.Gargenta@uWaterloo.Ca
------------------------------
End of java-interest-digest V1 #269
***********************************
-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com