[2964] in java-interest
java-interest-digest V1 #230
daemon@ATHENA.MIT.EDU (java-interest@java.sun.com)
Tue Oct 24 01:49:42 1995
From: java-interest@java.sun.com
To: java.sun.com!java-interest@java.sun.com
Date: Tue, 24 Oct 95 00:32:30 GMT
Not-Delivered-To: due to 12 Inability To Transfer
ORIGINAL MESSAGE ATTACHED
(rmail: Error # 2 'Problem with mailfile')
En-Route-To: marc
From smtp Tue Oct 24 01:32 MET 1995
>From java-interest Sun Oct 22 23:30:06 0700 1995 remote from java.sun.com
Received: (from majordom@localhost) by java.sun.com (8.6.12/8.6.12) id XAA27820 for java-interest-digest-outgoing; Sun, 22 Oct 1995 23:30:06 -0700
Received: from java.sun.com by spin.sinet.nl; Tue, 24 Oct 95 01:32 MET
Date: Sun, 22 Oct 1995 23:30:06 -0700
Message-Id: <199510230630.XAA27820@java.sun.com>
From: java.sun.com!owner-java-interest-digest
To: java.sun.com!java-interest-digest
Subject: java-interest-digest V1 #230
Reply-To: java-interest@java.sun.com
Errors-To: owner-java-interest-digest@java.sun.com
Content-Length: 22211
Content-Type: text
Precedence: bulk
X-Info: To unsubscribe, send 'unsubscribe' to java-interest-digest-request@java.sun.com
java-interest-digest Monday, 23 October 1995 Volume 01 : Number 230
In this issue:
C++ native modules!!
compile on PC, serve on SunOS...help!
Re: compile on PC, serve on SunOS...help!
Re: How to set the backgroud color?
Modality of dialogs/frames
Oct. 20 issue of J*** Notes
[Q] How HotJava running applet?
Components and containers
Thread in Beta .... again
Java for computer animation
standalone java applet
Documentation for classes/sun in Beta
Beta Protocol Handler
Finished first applet, now some questions...
----------------------------------------------------------------------
From: psenthil@iss.nus.sg (P Senthilkumar - RS)
Date: Thu, 19 Oct 1995 16:20:15 +0800 (SST)
Subject: C++ native modules!!
hi,
I dont know whether this is possible or not.
Is it possible to load a dll created from a c++ code.
I guess this is not possible. Becoz no where in the documents I find
this is mentioned. Also it was only illustrated for C code.
(I knew that the StepbyStep docs doesnt mention c++ anywhere, but I
just wanted to test it out. becoz iam desperately in need of this)
I got curious and tried playing with the Helloworld.c and tried
to link with the dll created using g++.
Please dont flame me for this. Because, Iam trying to use native c++
routines to create peristent object repository. Iam using Shore as
my Storage Manager.
Currently, my idea is this: If loading a dll (created out of c++) is
possible, then i thought System.loadLibrary() will be helpful for me
create object-types dynamically and there by make my system
extensible.
Please correct me if iam wrong, or if iam making some blind assumptions.
But it failed during linking.
To give a clear picture :
This is my modified hello.c
#include <StubPreamble.h>
#include "Helloworld.h"
#include <iostream.h>
void Helloworld_displayHelloworld(struct HHelloworld *t)
{
cout <<"adfsg"<<endl;
return;
}
I created libHelloworld.so by
g++ -G -I$JAVAHOME/include -I$JAVAHOME/include/solaris HelloWorld.c hello.C -o
libHelloworld.so
On running this I get
ld.so.1: /usr2/psenthil/java/bin/../bin/sun4/java: fatal: relocation
error: symbol not found: Helloworld_displayHelloworld__FPv: referenced
in /usr2/psenthil/hotjava-psk/native/cpp/libHelloworld.so
(/usr2/psenthil/hotjava-psk/native/cpp/libHelloworld.so)
java.lang.UnsatisfiedLinkError no Helloworld in LD_LIBRARY_PATH
at java.lang.Throwable.<init>(Throwable.java)
at java.lang.Error.<init>(Error.java)
at java.lang.LinkageError.<init>(LinkageError.java)
at java.lang.UnsatisfiedLinkError.<init>(UnsatisfiedLinkError.java)
at java.lang.Runtime.loadLibrary(Runtime.java)
at java.lang.System.loadLibrary(System.java)
at Helloworld.<clinit>(Helloworld.java:6)
at java.lang.UnsatisfiedLinkError displayHelloworld
at pgm.main(Helloworld.java:13)
LD_LIBRARY_PATH= <is properly set>
When i changed the cout and iostream to printf and compiled with g++ I
get the same error.
Any help and solutions are welcome.
Thanks in advance.
Senthil
- -----------------------**************-------------------
"Good judgement comes from experience. Experience comes
from bad judgement."
-- Jim Horning
- -----------------------**************-------------------
P. Senthil kumar Internet : psenthil@iss.nus.sg
Institute of System Sciences, Talk : psenthil@melon.iss.nus.sg
National University of Singapore, Tel : 7722583 (O)
Singapore -0511 : 4720790 (R)
- ------------------------------------------------------------------------
- -
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com
------------------------------
From: chwright@goesser.mit.edu
Date: Wed, 18 Oct 1995 22:00:44 -0400 (EDT)
Subject: compile on PC, serve on SunOS...help!
Hi,
I'm trying to use win95 to compile java and then move the class files
to a SunOS web server. Not working. Example: I wrote HelloWorld and
to get it to compile on the PC, included:
import awt.Graphics;
public class HelloWorld extends browser.Applet {
Moved it to SunOS and with Netscape2 get the error window containing such as:
I/O exception when loading: browser.Applet
java.lang.UnknownError browser/Applet
What am I doing wrong? I must be able to compile on the PC and serve/run
the web on SunOS.
Thanks in advance for easing much frustration,
Chantal Wright
- -
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com
------------------------------
From: flar@bendenweyr.Eng.Sun.COM (Jim Graham)
Date: Wed, 18 Oct 1995 19:37:52 -0700
Subject: Re: compile on PC, serve on SunOS...help!
Hi Chantal,
> I'm trying to use win95 to compile java and then move the class files
> to a SunOS web server. Not working. Example: I wrote HelloWorld and
> to get it to compile on the PC, included:
>
> import awt.Graphics;
> public class HelloWorld extends browser.Applet {
>
> Moved it to SunOS and with Netscape2 get the error window containing such as:
>
> I/O exception when loading: browser.Applet
> java.lang.UnknownError browser/Applet
>
> What am I doing wrong? I must be able to compile on the PC and serve/run
> the web on SunOS.
You are trying to run an Alpha applet in Netscape Navigator which only
supports Beta applets. The entire class tree was reorganized between
Alpha and Beta. If you want to use applets with Navigator 2.0, then you
will have to develop them with a Beta applet development environment,
which is currently only available on Solaris. The PC version of the
Beta development environment is not available yet (we're working on
it). See "http://java.sun.com/" for more details...
...jim
- -
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com
------------------------------
From: flar@bendenweyr.Eng.Sun.COM (Jim Graham)
Date: Wed, 18 Oct 1995 19:34:32 -0700
Subject: Re: How to set the backgroud color?
Hi Tony,
> 1. How do you set the background color within the applet area? The
setBackground(Color c)
It is implemented in Component so all Component objects support it
(including Applet).
> 2. This is probably related to the first one as well. When I load a gif
> with transparency index set, java seems to simply paint the transparent
> area into the default background color (grey), which doesn't realy
> achieve the desired transparent effect when you draw one image on the
> other. ANy insight?
Java doesn't paint anything for the transparent pixels of an image.
The background might be getting painted if you don't override update().
If your applet gets damage (i.e. it is behind some other window and
then that other window is moved away), the background of the exposed
or damaged area is filled with the background color and paint(Graphics g)
is called for you to repaint the applet.
If you call repaint(), then no background filling will occur but the
update(Graphics g) method will be called. If you don't override that
method, then the default implementation that will be executed for you
is to clear the background to the background color and to then call
paint(Graphics g).
...jim
- -
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com
------------------------------
From: rvhoof@nynexst.com (Ron van Hoof)
Date: Wed, 18 Oct 1995 22:58:22 -0400
Subject: Modality of dialogs/frames
Hi all!
I'm currently writing a backward chainer (inference mechanism)
and need to use an ask-dialog, in case a value for an attribute cannot
be found in the knowledge base.
Does anybody know how I can implement the modality for a frame.
(The current Java Dialog does not support modality yet and Netscape
2.0 doesn't support the dialogs at all (gives errors)).
Below I've given the methods calling the ask-dialog and the class
for the ask-dialog itself. Any feedback is welcome...
Ron
In the class Variable I have the following two methods:
public void traceValues() {
// Start tracing the value for the variable. First try to
// infer the variable based on the rules in the knowledge
// base, if this doesn't provide a value for the variable
// then if the variable is askable, ask for the value.
ruleBase.traceHandler().writeTrace("Tracing values for "+name);
infer();
if ((established() == false) && isAskable()) {
ruleBase.traceHandler().writeTrace("Asking value for "+name);
ask();
} // end if
setTraced(true);
} // traceValues
public void ask() {
AskDialog askDlg;
System.out.println("Entering ask");
askDlg = new AskDialog();
// process results dialog
if (askDlg.pressedButton().equals("OK")) {
System.out.println("OK");
setTraced(true);
value = askDlg.getText();
System.out.println("value: "+value().toString());
}
else if (askDlg.pressedButton().equals("Cancel")) {
setTraced(false);
System.out.println("Cancel");
askDlg.dispose();
} // end if
} // ask
Next is the class AskDialog itself:
class AskDialog extends Frame {
// Attributes
TextField askField;
String result = "";
String pressedButton = "";
// Methods
public AskDialog() {
//Set title of Dialog and make Dialog modal
super("Ask...");
// Create textfield
askField = new TextField(30);
Panel north = new Panel();
north.setLayout(new BorderLayout());
north.add("Center", askField);
// Create Button panel
Panel center = new Panel();
center.setLayout(new FlowLayout());
center.add(new Button("OK"));
center.add(new Button("Cancel"));
add("North", north);
add("Center", center);
// Set Dialog window size
resize(300, 100);
show();
} //AskDialog
public boolean action(Event evt, Object arg) {
if ("OK".equals(arg)) {
System.out.println("OK pressed");
pressedButton = "OK";
result = askField.getText();
//this.hide();
}
else if ("Cancel".equals(arg)) {
System.out.println("Cancel pressed");
pressedButton = "Cancel";
//this.hide();
}
return true;
} // action
public String pressedButton() {
return pressedButton;
} // pressedButton
public String getText() {
return result;
} // getText
} // AskDialog
- ---------------------------------------------------------------------
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
- ---------------------------------------------------------------------
- -
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com
------------------------------
From: mentor@io.org (David Forster)
Date: Sat, 21 Oct 1995 03:27:39 -0500
Subject: Oct. 20 issue of J*** Notes
The latest issue of J*** Notes is now available. About 800 messages have
been filtered and summarised for you all to read! This week I had the kind
assistance of Mike Shaver, William D. Clendening, and Rehan Zaidi. Read the
issue for more details:
http://www.io.org/~mentor/J___Notes.html
Note: some items are still missing from this issue. They will hopefully be
put in on Monday morning. Read it now for the announcements and visit again
when the rest of the content is there.
Enjoy! Have a good weekend.
Cheers,
David Forster <br><a href="http://www.io.org/~mentor">
Mentor Software Solutions </a><br>
+1 905 832 4837 <br>
------------------------------
From: "Kyung Soon, Park" <sosarian@nuri.net>
Date: Thu, 19 Oct 1995 12:16:00 +0900
Subject: [Q] How HotJava running applet?
Why is Hotjava.exe so small?
When running an applet in Hotjava, is it use API's in subdirectories in HotJava?
In Netscape 2.0b1j, there is no API classes in subdirectory.
But applet could run.
How can I understand these mechanism?
######################################################
I*NET Technologies, Inc. (http://www.iworld.net)
Member of Technical Staff
Mr. Kyung Soon, Park
Email : sosarian@nuri.net
TEL : +82-2-538-6941
URL : http://sol.nuri.net/~sosarian
######################################################
- -
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com
------------------------------
From: edanuff@protagonist.com (Ed Anuff)
Date: Wed, 18 Oct 1995 21:06:25 -0800
Subject: Components and containers
Like others on this list, I'm having a tough time with getting components
to lay out and resize correctly. I've included the source for an example
applet that I'm using to test this out. I would expect that the panel is
layed out at 100,100 and that the canvas would be positioned at 100,100
within the panel.
- ----------------------
|Applet |
| |
| |
| --------------|
| |Panel1 |
| | |
| | |
| | ------|
| | |\ | /|
| | | \|/ |
| | |--\--|
| | | /|\ |
| | |/ | \|
- ----------------------
When run, everything displays at 0,0 (in the applet viewer - in Netscape
nothing displays). My question is whether this is supposed to be the way
this works or if its a bug? If its a bug, is it planned to be fixed in the
next rev? BTW, I'm aware of the reasons why absolute placement is not a
good idea, but nothing in this example is platform dependent.
Ed
- -Hierarchy.java start---------------------------
import java.util.*;
import java.applet.*;
import java.awt.*;
public class Hierarchy extends Applet {
Panel panel1;
TestCanvas theCanvas;
public void init() {
resize(400, 400);
setLayout(null);
panel1 = new Panel();
panel1.setLayout(null);
panel1.reshape(100,100,200,200);
add(panel1);
theCanvas = new TestCanvas();
theCanvas.reshape(100,100,100,100);
panel1.add(theCanvas);
panel1.move(100,100);
theCanvas.move(100,100);
repaint();
System.out.println(location().x + ", " + location().y + ",
" + size().width + ", " + size().height);
System.out.println(panel1.location().x + ", " +
panel1.location().y + ", " + panel1.size().width + ", " +
panel1.size().height);
System.out.println(theCanvas.location().x + ", " +
theCanvas.location().y + ", " + theCanvas.size().width + ", " +
theCanvas.size().height);
}
public void start() {
repaint();
System.out.println(location().x + ", " + location().y + ",
" + size().width + ", " + size().height);
System.out.println(panel1.location().x + ", " +
panel1.location().y + ", " + panel1.size().width + ", " +
panel1.size().height);
System.out.println(theCanvas.location().x + ", " +
theCanvas.location().y + ", " + theCanvas.size().width + ", " +
theCanvas.size().height);
}
}
class TestCanvas extends Canvas {
public TestCanvas() {
}
public void paint(Graphics g) {
Rectangle r = bounds();
g.drawRect(0, 0, r.width-1, r.height-1);
g.drawLine(0, 0, r.width, r.height);
g.drawLine(r.width, 0, 0, r.height);
g.drawLine(0, r.height / 2, r.width, r.height / 2);
g.drawLine(r.width / 2, 0, r.width / 2, r.height);
}
}
- -Hierarchy.java end-----------------------------
Ed Anuff
Protagonist Interactive
edanuff@protagonist.com
http://www.protagonist.com/
- -
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com
------------------------------
From: Edith Au <edith@pencom.com>
Date: Thu, 19 Oct 1995 00:08:01 -0400 (EDT)
Subject: Thread in Beta .... again
Hi,
I have posted this message 2 days ago but received no response. Can
someone please help?
=============================================
In Animator.java (beta demo) run() method
Thread me = Thread.currentThread();
....
.....
//engine is a thread started in start() method
while (maxWidth > 0 && maxHeight > 0 && engine == me)
{....}
What is the role of thread me? Why does it need to compare
engine and me?
If I have another applets running on the same page, will
Thread.currentThread() = thread from another applet since only 1
thread is "physically" running at a time ? If it is true,
then the Blink applet might cause problem on a page with 2 or
more applets
public void run()
{
while (true)
try { Thread.currentThread().sleep(speed);}
.......
}
It might put the wrong thread to sleep!
Can someone help?
Cheers,
Edith
- -
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com
------------------------------
From: wahrman@tribeca.ios.com (Michael Wahrman)
Date: Sat, 21 Oct 1995 11:47:54 -0800
Subject: Java for computer animation
I have been "lurking" on this list since it was
announced, (courtesy of Bill Danielson of Sun, and
my roommate at the Rand Corporation), and I am considering
using Java in a number of film making applications.
What is the status of the port to SGI?
Is there any ongoing effort to interface Java to Open
Inventor, even if the effort is not complete.
Thank you.
Michael Wahrman
New York City
- ----------
Please use internet return address of "wahrman@tribeca.ios.com"
for the time being. This will probably change by the end of the
year. Thank you.
------------------------------
From: julie m <julie@futuretense.com>
Date: Sat, 21 Oct 1995 20:51:13 -0400
Subject: standalone java applet
Hi all
I've created an applet with a main that can 'stand alone' via execution as
java MyThing
and all works well. Note that this applet/application does not fetch images.
Next I try to create an applet that should, if needed, be able to stand
alone in the same manner. However, it crashes as follows:
Exception in thread "main" java.lang.NullPointerException
at java.applet.Applet.getAppletContext(Applet.java:83)
at java.applet.Applet.getImage(Applet.java:110)
at java.applet.Applet.getImage(Applet.java:122)
at Gazette.getImage(Gazette.java:189)
at Gazette.addFutureTense(Gazette.java:331)
at Gazette.addSectionContent(Gazette.java:435)
at Gazette.addContent(Gazette.java:467)
at Gazette.makePublication(Gazette.java:230)
at Gazette.init(Gazette.java:172)
at Gazette.main(Gazette.java:535)
The trace indicates that there is no applet stub. Looks like I need one to
deal with images outside the appletviewer? I don't recall seeing that in the
documentation, but more importantly...what steps do I need to take to be
able to have a standalone application read in an image?
Thanks
julie
------------------------------
From: ekim@wheel.bellcore.com (Michael Mills)
Date: Sun, 22 Oct 1995 12:07:53 -0400 (EDT)
Subject: Documentation for classes/sun in Beta
Hi,
There does not seem to be any documentation or source in the Beta
release for the classes in "java/classes/sun". Is this an oversight
or are we being discouraged from using them? (Or did I miss something).
Thanks,
Mike
------------------------------
From: ekim@wheel.bellcore.com (Michael Mills)
Date: Sun, 22 Oct 1995 12:17:41 -0400 (EDT)
Subject: Beta Protocol Handler
Hi,
1) Is there an example of a protocol handler for the pre-beta release
somewhere?
Thanks,
Mike
------------------------------
From: Eric Richards <richards@teleport.com>
Date: Sun, 22 Oct 1995 21:32:43 -0700
Subject: Finished first applet, now some questions...
Hello! (I <heart> Java!)
I've tackled my first simple applet and, being that I decided to learn by
doing rather than studying everything first, I have some basic questions to
fill in my gaps.
(Oh, and rather than post all the source to this applet in question, please
see <URL:http://www.teleport.com/~richards/Java/> for a pointer via my new Java
Barista notebook.)
The applet is just a simple animator that takes a single filmstrip gif file
and then copies the current frame out of the image to the paint() method's
graphic. To copy the current frame, a line like the following is used:
g.drawImage( fImageStrip, 0, -(fFrame * fFrameHeight), this );
Why is the negative height needed? Why can't a positive one be used?
I used the Media Tracker class to make sure the image is really acquired
before being used. But, I have to do the following to get valid width:
fFrameWidth = fImageStrip.getWidth(this);
fFrameHeight = fImageStrip.getHeight(this) / fNumFrames;
fFrameWidth = fImageStrip.getWidth(this);
The first fFrameWidth gets -1. After that, the pump seems "primed." Is there
a more proper way of dealing with an Image instance after the image is known to
have been retrieved?
The only thing really special about this animator is that it has an option
for the first frame to be a background and all subsequent frames "transparent"
with foreground images to go over the background. Right now, this is too
unattractive to be worth it. While normal animation appears smooth, this
animation lurches along, skipping frames. I can only guess that since 3
drawImage() calls have to be used instead of one (and one of those deals with a
transparent image) the overhead takes too much time and screen updates are
dropped. I have an idea for a workaround...
-- Eric
------------------------------
End of java-interest-digest V1 #230
***********************************
-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com