[5271] in java-interest
No subject found in mail header
daemon@ATHENA.MIT.EDU (klkok@csam.com.MY)
Sun Feb 4 16:51:28 1996
From: klkok@csam.com.MY
Date: Sun, 4 Feb 1996 20:33:39 +0100
X-Envelope-From: daemon@java.sun.com
Apparently-To: <java-interest@java.sun.com>
(8.6.10/8.6.10) with ESMTP id KAA02757 for <dyerr@gdls.com>; Fri, 2 Feb 1996
10:06:36 -0500
Received: (from daemon@localhost) by java0.javasoft.com (8.6.12/8.6.12) id
SAA03748 for java-interest-recipients; Thu, 1 Feb 1996 18:32:00 -0800
Received: (from majordom@localhost) by java0.javasoft.com (8.6.12/8.6.12) id
SAA02872 for java-interest-outgoing; Thu, 1 Feb 1996 18:20:42 -0800
Date: Thu, 1 Feb 1996 16:16:23 +0800 (SST)
From: Kok Kai Loon <klkok@csam.com.MY>
Subject: How is Window work in Java?
To: java-interest@java.sun.com
Message-Id: <Pine.3.07.9602011623.A22652-c100000@csam>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Sender: owner-java-interest@java.sun.com
Precedence: bulk
X-Info: To unsubscribe, send 'unsubscribe' to java-interest-request@java.sun.com
Hello guys,
I am very new to this Java programming. Currently I am in the progress of
learning the language, I am using Beta JDK in Solaris 2.4.
My problem is, how to create a Simple Window with MenuBar on it. I have
work out something, the window is showing out on the screen (I am
using Netscape 2.0 beta 4) but with the message of "Untrusted Java Applet
Window" on it's status line, also the MenuBar that I created is not shown.
Hope someone could help me out.
Thanks in advance.
KLKOK
(klkok@csam.com.MY)
Attachment of my sample code;
- --------------------------------------------------------------------------
public class MainScreen extends Applet{
Window MainWindow;
public MainScreen(){
MenuBar MainMenu;
Menu FileMenu;
Menu EditMenu;
Menu OptionMenu;
Menu HelpMenu;
/* Create FileMenu */
FileMenu = new Menu("File");
FileMenu.add(new MenuItem("Open"));
FileMenu.add(new MenuItem("Close"));
FileMenu.add(new MenuItem("-"));
FileMenu.add(new MenuItem("Exit"));
/* Create EditMenu */
EditMenu = new Menu("Edit");
EditMenu.add(new MenuItem("Copy"));
EditMenu.add(new MenuItem("Past"));
/* Create OptionMenu */
OptionMenu = new Menu("Option");
OptionMenu.add(new MenuItem("Setting"));
/* Create HelpMenu */
HelpMenu = new Menu("Help");
HelpMenu.add(new MenuItem("Help"));
HelpMenu.add(new MenuItem("-"));
HelpMenu.add(new MenuItem("About"));
/* Create MenuBar */
MainMenu = new MenuBar();
MainMenu.add(FileMenu);
MainMenu.add(EditMenu);
MainMenu.add(OptionMenu);
/* Create MainWindow and attach with it Menus */
Frame MainMenuFrame;
MainMenuFrame=new Frame(new String("CSA Sample Application"));
MainWindow=new Window(MainMenuFrame);
MainWindow.show();
}
}
- -
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com
Status: RO
X-Info: Evaluation version at abraracourcix.194.51.174.241
------------------------------
From: Jean-Marc Giblaine (GC21: French Bank G) <v-jeang@microsoft.com>
Date: Fri, 2 Feb 96 07:59:14 TZ
Subject: Re: Why IBM ports WIN31?
May be , it's the only way they found to run Java under OS2 !!! ;-))
- ----------
| From: <bosch@mcs.com>
| To: <jungys@daou.co.kr>; <java-interest@java.sun.com>
| Subject: Re: Why IBM ports WIN31?
| Date: Tuesday, January 30, 1996 9:21PM
|
| *************
| Hi..
|
| I had a question about java porting. I have heard about IBM porting java to
| WIN31.
| Why does IBM port java to WIN31? Isn't this job due to Microsoft?
|
| Thanks
| *************
|
| I'd say that it is a job caused by giving in to Microsuck and because
corporate sales
| of Windows 95 is slower than molasses in January... Of course, I
personally think
| that the real question is "Why _is_ IBM porting Java to Windows 3.1?"
since everyone
| knows that Win3.1 is lousy at threading since it is not a
multi-threaded environment.
| Microsoft won't do the porting because its pushing Windows NT and
Windows 95 and not
| Windows 3.1x.
| +---/!-KA9VYG-------------------------------------------------------+
| ( / ! !* ! !** !** !*** ! bosch@mcs.com OR abosch@elca.org )
| ( /**! ! * ! ! ! !*/ !** ! /! / <insert your quip here> )
| +/ !-! *!-!** -! *-!***-!/ !/-----------------------------------+
| 0 # # # # # # 79
| -
| This message was sent to the java-interest mailing list
| Info: send 'help' to java-interest-request@java.sun.com
|
------------------------------
From: brian sharon <brian@jjt.com>
Date: Fri, 2 Feb 1996 10:24:55 -0600 (CST)
Subject: PICT, JPEG, etc. (was Re: Images)
I'm sure others have also responded, but - JPEG support is included.
Just do a getImage() the same as you would for a GIF file.
I've never tried PICT but I'd be really surprised if it's in there. PICT
is really easy to read on a Mac and really hard everywhere else. The PICT
definition in Inside Macintosh is confusing to say the least (and crosses
2 volumes of the book). Apple actively discourages you from trying to
figure out how a PICT file is stored; they'd rather you used their opaque
function calls to get the image data. I'm expressing no opinion here on
the wisdom of that approach (I don't think this is the place); I can say I
had a nightmarish time once figuring out how a JPEG-compressed PICT file
was stored, just so that I could create one with a Windows app. So I
would say that PICT is not a terribly portable solution. TIFF would be a
better choice for a portable image format to add support for, if you ask
me.
Not that anyone did.
But then again, after the big merger, maybe PICT will become the new Java
standard image file format! Stay tuned!
- --brian http://www.paranoia.com/~brian
On Thu, 1 Feb 1996 SAXM@aol.com wrote:
> Is there a class to manipulate JPEG and PICT files or am I limited to using
> 8-bit GIF images in my applications?
> Thank you.
> SAXM
> -
> This message was sent to the java-interest mailing list
> Info: send 'help' to java-interest-request@java.sun.com
>
------------------------------
From: jip@hp23.itc.nl
Date: Fri, 2 Feb 96 17:39:08 MET
Subject: [none]
I just dropped in check, something was brewing here?
------------------------------
From: ra104@cosc.bsu.umd.edu (Chris Gokey)
Date: Fri, 2 Feb 1996 11:48:31 -0500
Subject: java.awt.ps
Hi!
I would like to be able to print this java.awt.ps out.
I found rops, a post script viewer for the pc, but it
did not seem to work.
Does anyone know a a postscript viewer for Windows that
will work?
I also have Microsoft Word, is there a way I can load in
a post script file with it????
Thanks,
Chris Gokey
ra104@cosc.bsu.umd.edu
------------------------------
From: abardin@VNET.IBM.COM
Date: Fri, 2 Feb 96 10:21:52 MST
Subject: mouse troubles
I tried capturing Event.MOUSE_DOWN in the handleEvent method but the routine wa
s never called. When I printed out MOUSE_DOWN and the evt.id that was generated
they were different. the actual event was 701 but MOUSEDOWN was 501. is this
a known bug?
I've also had trouble capturing mouseEnter/Exit in frames that have components
on them. It seems like the routine gets called at best once and then no more.
any ideas?
ariel
------------------------------
From: cwi@lanl.gov (Craig Idler)
Date: Fri, 2 Feb 1996 10:52:01 -0700
Subject: couple of easy questions
Hi,
Could some kind person answer the following questions:
1. On page 101 of hooked on Java there are methods for the File class called
write and close. These don't seem to exist in the java.io.File class.
How does one do these things?
2. Does a method exist to convert a String to and integer?
Thank you,
Craig
------------------------------
From: SATEESHB@inf.com
Date: Fri, 2 Feb 96 13:12:09 EST
Subject: [none]
FF 02 Feb 95 22:35:44 EST
Date: RhpF
FF 02 Feb 95 22:35:44 EST
From: "SATEESHB" <SATEESHB@smtp_gw.inf.com>
Encoding: 24 Text
Message-Id: <9601028232.AA823299771@smtp_gw.inf.com>
To: flar@bendenweyr.Eng.Sun.COM (Jim Graham),
java-interest@java.sun.com,
java-http-interest@enete.com
Subject: Grid Layout problem.
Hello,
I'm facing some problems in using the GridBaglayout.
The documentation seems to mean that one could fix the size, position
of the components.
gridwidth is supposed to be in "cells". What does it translate to in
terms of pixels (or any more fixed units).
I'm unable to even get a kind of a flow layout (with the number of
components in each line spec. by me)
I would appreciate any kind of help in this regard.
Also is it possible to have components whose display area overlap? (I
am thinking in terms of having one of them to pop up now and then)
Please think of this as SOS.
Thanks
Gans.
Gans@inf.com
------------------------------
From: Doug Dotson <dotson@bud.tate.com>
Date: Fri, 2 Feb 1996 13:16:06 -0500 (EST)
Subject: Re: Why IBM ports WIN31?
>
> I had a question about java porting. I have heard about IBM porting java to
> WIN31.
> Why does IBM port java to WIN31? Isn't this job due to Microsoft?
It's pretty obvious to me. Do you remember when OS/2 Version 2 came out.
IBM claimed that OS/2 ran Windows 3.1 programs better than Windows itself
does. Most OS/2 users are running Windows 3.1 apps since relatively few
apps are available to run directly under OS/2. Porting JAVA to Win3.1 allows
JAVA enabled web bowsers to run under OS/2.
Doug Dotson
dotson@tate.com
------------------------------
From: Ryan Bruner <rbruner@svr1.corpnet.com>
Date: Fri, 02 Feb 1996 13:51:36 -0500
Subject: Ports to other Unix OS?
Are there any attempts to port Java to other Unix operating systems? It
would seem to me that porting Java (at least the interpreter and compiler)
to another Unix would be a lot easier to do than porting it to Windows
and Mac. And yet, there appears to be no attempt at this point.
Specifically, we need it ported to BSDi, or a Unix that can be run on
an Pentium-based machine. I don't understand why it isn't even ported to
Solaris x86.
______________________________________________________________________________
== Ryan J. Bruner ========== "And whatever you do, whether in word or deed, ==
== Internet Connect ======== do it all in the name of the Lord Jesus, giv- ==
== rbruner@corpnet.com ===== ing thanks to God the Father through Him." ==
------------------------------
From: "COLLINS-LEE" <collinsl@norcmail.uchicago.edu>
Date: Fri, 02 Feb 96 13:54:17 CST
Subject: [none]
Java Gurus,
Can anyone explain to me how I can load an applet dynamically through
a Java application and pass it <Param> information that would normally
be with the applet tag.
The *real* question is, how does an applet loaded from an HTML page
get the parameters? What class? What method? When?
//----------------------------------------------------------------------
class LeeCollins extends JavaDeveloper implements IllustriousJavaCode
{
public LeeCollins()
{
MailAddress ma =
new MailAddress("collinsl@norcmail.uchicago.edu");
}
}
//----------------------------------------------------------------------
------------------------------
From: Arthur.Vanhoff@Eng.Sun.COM (Arthur van Hoff)
Date: Fri, 2 Feb 1996 09:33:23 -0800
Subject: Re: Is 'new' really necessary?
Hi Kerry,
> Can someone tell me why the 'new' keyword was used in Java?
> It appears to me that its only use is as a token to
> denote that a class instanciation is coming up next.
> It seems redundant in that regard.
It is my fault. Despite it being somewhat redundant, I suggested that
it was changed to the way it is because it makes heap allocations more
explicit. Apart from strings and string concatenation, all heap allocations
in Java are accompanied by the "new" keyword in the code. There are no
suprises like in C++ where the compiler allcoates temporary objects
when needed, which can make your programs very inefficient. In Java you
know what is going on, because you write the code.
> Given:
> (a) Date d = new Date(CurrentTime); // Java compiler likes
> (b) Date d(CurrentTime); // Java compiler doesn't like
> (c) Date d; // Java compiler likes
>
> Statement (a) uses the 'new' keyword. The disadvantage
> is that it messes up C++ programmers to thinking that a dynamic
> variable is being created (yes, Java doesn't have pointers but some
> habits are hard to break).
I'm not sure if I understand. It does allocate a heap allocated
object.
> In addition, one has to type the class
> symbol again, and the equal character.
But you can write:
Foo f = new Bar();
as long as Bar is compatible with Foo.
> Statement (b) is far more terse and natural for C++ programmers.
I disagree. In C++ these objects are stack allocated and not heap
allocated, the sematics are totally different.
> Statement (c) needs to be put in contrast to the following:
> Date d = new Date();
>
> I hope you see my point. An instanciation is an instanciation.
> Why must I think about a "new" object?
Despite it being more verbose, I think it is more clear to use (a).
Anyway, it is too late to change.
Have fun,
Arthur van Hoff
------------------------------
From: David.Geary@Central.Sun.COM (David Geary)
Date: Fri, 2 Feb 1996 09:36:07 -0700
Subject: Re: Is 'new' really necessary?
> Can someone tell me why the 'new' keyword was used in Java?
> It appears to me that its only use is as a token to
> denote that a class instanciation is coming up next.
> It seems redundant in that regard.
>
> Given:
> (a) Date a = new Date(CurrentTime); // Java compiler likes
> (b) Date b(CurrentTime); // Java compiler doesn't like
> (c) Date c; // Java compiler likes
>
> Statement (a) uses the 'new' keyword. The disadvantage
> is that it messes up C++ programmers to thinking that a dynamic
> variable is being created (yes, Java doesn't have pointers but some
> habits are hard to break).
Actually, that's exactly what's happening: new Date(CurrentTime)
instantiates an object on the heap and assigns (the object reference)
a to it.
Java may not have pointer syntax, or the ability to access individual
memory locations, but each Java object is really a reference to an
object, so in some sense, _everything_ in Java is a pointer. There
are no local (stack-based) objects in Java.
Realize that (c) above creates a null REFERENCE to a Date, and does
not create a local Date object, as it would in C++. Also note that
the following:
Date a = new Date(CurrentTime);
Date c;
c = a;
is equivalent to the following C++ code:
Date& a = *(new Date(CurrentTime));
Date& c = 0;
c = a;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
David Geary "You and I have nothing more to say
geary@rmtc.Central.Sun.COM I will do more than talking some day"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
------------------------------
End of java-interest-digest V1 #71
**********************************
-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com