Class information in a static method

1999-10-07 Thread Jesper Nordenberg

This might be slightly off topic, but I really need help with this.

Is there any way to obtain the Class-instance associated with the current class in a 
static method? Obviously, this.getClass() doesn't work ;)

--
| Jesper Nordenberg, M.Sc. in C.S.E.NNL Technology AB
| E-mail: [EMAIL PROTECTED] Teknikringen 1A
| Phone:  +46 13 211400 S-583 30 Linköping
| Internet: www.nnl.se, wap.nnl.se  SWEDEN




--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: libjava.so not found

1999-10-07 Thread Vlatka Davidovic

On Wed, 6 Oct 1999, SteveC wrote:

> 
> Then put /jdk1.2/bin/ in the path and run ./javac
> which reports it can't find libjava.so.
> 

I think it is known bug. Try to put /usr/local/jdk1.2/bin/ in your PATH
variable and run javac. 
Or if you are in jdk1.2/ directory try bin/javac. 
Not from ./


 - Vlatka - 




--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: Class information in a static method

1999-10-07 Thread Nathan Ehresman

> This might be slightly off topic, but I really need help with this.
> 
> Is there any way to obtain the Class-instance associated with the current class in a 
>static method? Obviously, this.getClass() doesn't work ;)

Pass in a reference to the class.

Nathan Ehresman


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: Class information in a static method

1999-10-07 Thread David Marshall


 
Jesper Nordenberg wrote:
This might be slightly off topic, but I really need
help with this.
Is there any way to obtain the Class-instance associated with the current
class in a static method? Obviously, this.getClass() doesn't work ;)
 
You can use the static method Class.forName() on the Class class itself.
So, if your static method is in the class 'bar' in the package 'com.foo',
the fragment:
Class cl = Class.forName("com.foo.bar");
will give you the Class-instance you're looking for.
--
David Marshall  email:  [EMAIL PROTECTED]
President   phone:  1-941-596-2480
VM Systems, Inc.    fax:    1-941-596-2483
 
 


Re: Class information in a static method

1999-10-07 Thread Weiqi Gao

Jesper Nordenberg wrote:
> 
> Is there any way to obtain the Class-instance associated with the
> current class in a static method? Obviously, this.getClass() doesn't
> work ;)

If you know the class' name, and I suspect that you do since you are in
a static method of the class, you can do a Class.forName(className).

Each derivative class have to override this method if the obtained Class
is used in some substantial way.

-- 
Weiqi Gao
[EMAIL PROTECTED]


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



OT Re: Class information in a static method

1999-10-07 Thread jools enticknap

>This might be slightly off topic, but I really need help with this.
>
>Is there any way to obtain the Class-instance associated with the current 
>class in a static method? Obviously, this.getClass() doesn't work ;)
>

If the class is call com.blah.Stuff, use com.blah.Stuff.class; to get the 
java.lang.Class for a class.

eg.

package com.blah;

class Stuff {
public static void doIt()
{
 Class c = com.blah.Stuff.class;

}

}

Regards

--Jools

__
Get Your Private, Free Email at http://www.hotmail.com


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



TYA Mirror in Germany

1999-10-07 Thread Willi Richert

I have mirrored the newest version of tya (1.5-2) at

http://www.richert.de/opensource/tya

Hopefully anybody has now a faster download.

Have fun,
willi


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: Class information in a static method

1999-10-07 Thread Paul Mclachlan

At  8:32 10 Oct 1999 -0500, Weiqi Gao wrote:

> Jesper Nordenberg wrote:
> > 
> > Is there any way to obtain the Class-instance associated with the
> > current class in a static method? Obviously, this.getClass() doesn't
> > work ;)
> 

Use the special variable 'MyClass.class'.  (not in 1.0.2)

Paul


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



RE: Class information in a static method

1999-10-07 Thread Miles Sabin

> If you know the class' name, and I suspect that you do 
> since you are in a static method of the class, you can 
> do a Class.forName(className).

Better still, className.class, and have it resolved at
compile time rather than by a runtime lookup. 

Cheers,


Miles

-- 
Miles Sabin  Cromwell Media
Internet Systems Architect   5/6 Glenthorne Mews
+44 (0)181 410 2230  London, W6 0LJ
[EMAIL PROTECTED]   England


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: Class information in a static method

1999-10-07 Thread Juergen Kreileder

> Weiqi Gao writes:

Weiqi> Jesper Nordenberg wrote:
>> 
>> Is there any way to obtain the Class-instance associated with the
>> current class in a static method? Obviously, this.getClass() doesn't
>> work ;)

Weiqi> If you know the class' name, and I suspect that you do
Weiqi> since you are in a static method of the class, you can do a
Weiqi> Class.forName(className).

Weiqi> Each derivative class have to override this method if the
Weiqi> obtained Class is used in some substantial way.

Static methods can't be overriden, a static method _hides_ methods of
the same name in superclasses.  See section 8.4.6.1 and 8.4.6.2 in the
JLS.


Juergen

-- 
Juergen Kreileder, Blackdown Java-Linux Porting Team
http://www.blackdown.org/java-linux.html


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



WebRun

1999-10-07 Thread Michael Sinz

I was just wondering who else is interested in WebRun and if anyone
has tried it yet.

WebRun is a tool to load and run applications from a web server including
support for password entry.  (Actually it supports any URL type that your
Java VM supports)

I wrote this to help make it possible to have our clients run full Java
applications without having to worry about distribution problems.
(The applications always need to contact the server for real-time data
anyway thus they would be useless without a network anyway)

See http://www.nextbus.com/WebRun for the information.  I have released
this publicly as others may find it useful.

note - this is all done in a *single* class that acts as a URL aware
class loader that includes basic authentication support - the goal was
to have this be as simple as possible.




-- 
Michael Sinz  Technology and Engineering Director/Consultant
"Starting Startups" mailto:[EMAIL PROTECTED]
My place on the web ---> http://www.users.fast.net/~michael_sinz



--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: Class information in a static method

1999-10-07 Thread Godmar Back

> 
> > If you know the class' name, and I suspect that you do 
> > since you are in a static method of the class, you can 
> > do a Class.forName(className).
> 
> Better still, className.class, and have it resolved at
> compile time rather than by a runtime lookup. 
> 

Miles, "className.class" is just a short-hand for this code: 

{
...
if (_className == null) {
_className = getClassName("className");
}
...
}

private static Class _className;
private static getClassName(String cname) {
try {
return (Class.forName(cname));
} catch (ClassNotFoundException _) {
throw new NoClassDefFoundError(_.getMessage());
}
}

In other words, you're saving a try/catch clause at the expense of
one hidden static variable.

For example, this a.java

public class a {
Class x() {
return (a.class);
}
}

is compiled into:

public class a extends java.lang.Object {
static java.lang.Class class$a;
public a();
/* Stack=1, Locals=1, Args_size=1 */
static java.lang.Class class$(java.lang.String);
/* Stack=3, Locals=2, Args_size=1 */
java.lang.Class x();
/* Stack=2, Locals=1, Args_size=1 */
}

Method a()
   0 aload_0
   1 invokespecial #8 
   4 return

Method java.lang.Class class$(java.lang.String)
   0 aload_0
   1 invokestatic #12 
   4 areturn
   5 astore_1
   6 new #5 
   9 dup
  10 aload_1
  11 invokevirtual #13 
  14 invokespecial #9 
  17 athrow
Exception table:
   from   to  target type
 0 5 5   

Method java.lang.Class x()
   0 getstatic #11 
   3 ifnull 12
   6 getstatic #11 
   9 goto 21
  12 ldc #1 
  14 invokestatic #10 
  17 dup
  18 putstatic #11 
  21 areturn


Hope that helps,

- Godmar


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Applet transparency?

1999-10-07 Thread Roll, Greg

Hi All,
 
Anyone know if there a way to set an applets background color to be
transparent? 
 
Greg E. Roll


BT Office Products Intl.
Interface/Conversions Team
phone - (817) 323-1300 ext. 2921
e-mail  - [EMAIL PROTECTED] 


 Tech Tools.gif


Java on RedHat 6.1

1999-10-07 Thread Dan Iuster

RedHat has just released the 6.1 version of Linux.  I am curious if
anyone has had any experience with the 1.1.7, 1.1.8 or 1.2 JDK and JRE
on RedHat 6.1.  I have some rather large applications to port, and I
would like to know if there are any known pitfall introduced by the new
kernel.  I believe 6.1 is based on the 2.2.12 kernel.

Thanks in advance,
Dan Iuster
[EMAIL PROTECTED]


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: TYA Mirror in Germany

1999-10-07 Thread Gunjan

Friends
I am trying to install oracle server 8.1.5 which uses jre1.1.6v5 (glibc).

I get an error saying
illegal option green
 when the installation process begins intializing JRE.

Thanks in advance
Gunjan
- Original Message -
From: Willi Richert <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, October 07, 1999 10:29 AM
Subject: TYA Mirror in Germany


> I have mirrored the newest version of tya (1.5-2) at
>
> http://www.richert.de/opensource/tya
>
> Hopefully anybody has now a faster download.
>
> Have fun,
> willi
>
>
> --
> To UNSUBSCRIBE, email to [EMAIL PROTECTED]
> with a subject of "unsubscribe". Trouble? Contact
[EMAIL PROTECTED]
>
>
>



--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: Applet transparency?

1999-10-07 Thread Paul Mclachlan

At 12:24 10 Oct 1999 -0500, Roll, Greg wrote:

> Anyone know if there a way to set an applets background color to be
> transparent? 

Wouldn't that be wonderful?  I wish there was, too.

A couple of ideas.

If it's just a colour you're after, just set it in the applet.  An option
is to have a tiny 'startup' class (that doesn't directly reference anything
else) that can be loaded really quickly to just change the colour, and then
Class.forName() the rest of the applet.

If you want to see the background image, a bit of careful placement and
tiling in the applet startup class might make it appear as if it was
transparent.

[ If I'm mistaken, I'd -love- to hear the One True Way to do this ]

Paul


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



RE: Applet transparency?

1999-10-07 Thread Roll, Greg

No, setting it to null will yield the default as the background color.

GR

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Thursday, October 07, 1999 2:16 PM
To: [EMAIL PROTECTED]
Subject: Re: Applet transparency?


Try setting the background color to null.

I think that works.

-Jerry


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



RE: Applet transparency?

1999-10-07 Thread Dustin Lang


Hi,

> Try setting the background color to null.

One might suppose that what should happen is that the browser would leave
the background in its original pristine state, and then unless the applet
painted itself, that background would stay the way it was.  I think most
(read: all) browsers paint the applet with some default colour (ugly
gray?).

An alternate solution would be for the applet to ask the browser what the
background looked like originally.  This could/would be done through
AppletContext.  Alas, such a method does not exist, so you're pretty much
out of luck, at least in the general case.

It's important to make the distinction between actually making the applet
transparent and making it look transparent.  As far as I can see in
general, the first is not possible, while the second is relatively easy.

Cheers,
dstn.


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: Java on RedHat 6.1

1999-10-07 Thread Riyad Kalla

I am using it and it works wonderfully (1.2prev2) that is with AnyJ 1.3.1.

-Riyad

Dan Iuster wrote:

> RedHat has just released the 6.1 version of Linux.  I am curious if
> anyone has had any experience with the 1.1.7, 1.1.8 or 1.2 JDK and JRE
> on RedHat 6.1.  I have some rather large applications to port, and I
> would like to know if there are any known pitfall introduced by the new
> kernel.  I believe 6.1 is based on the 2.2.12 kernel.
>
> Thanks in advance,
> Dan Iuster
> [EMAIL PROTECTED]
>
> --
> To UNSUBSCRIBE, email to [EMAIL PROTECTED]
> with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

--
[  Riyad Kalla  ]
[   [EMAIL PROTECTED]   ]
[   CS - Major  ]
[ University of Arizona ]




--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: Java on RedHat 6.1

1999-10-07 Thread Paolo Ciccone

On Thu, Oct 07, 1999 at 10:49:58AM -0700, Dan Iuster wrote:
> RedHat has just released the 6.1 version of Linux.  I am curious if
> anyone has had any experience with the 1.1.7, 1.1.8 or 1.2 JDK and JRE
> on RedHat 6.1.  I have some rather large applications to port, and I
> would like to know if there are any known pitfall introduced by the new
> kernel.  I believe 6.1 is based on the 2.2.12 kernel.

I don't know about RH 6.1 but I'm using Mandrake 6.1 with kernel 2.2.13 and
JDK 1.2 works normally.

-- 
Paolo


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Q: Working JDK1.1 for Sparc Linux?

1999-10-07 Thread Gary E Rafe

A week later and no responses, so we'll try again.

We recently resurrected an old IPX for a project here,
which requires Apache/JServ.
The box was running Solaris 2.6, but was just too sluggish,
even with the PowerUP CPU.
Having heard the performance claims of the recent Sparc Linux ports,
We loaded a fresh RedHat 6.0 installation on it the other day,
and have been impressed by its new responsiveness.

Our primary interest in the box is as an Apache/Jserv & MySQL server.
We're now finding that the available JDK1.1 Sparc ports (1.1.6v4a, 1.1.5)
core dump on this system with no visual complaint
(we installed a libc5 RPM from the RedHat 4.2 updates, to no avail),
and the JDK1.2 "pre-v3" port starts to run, but appears to "hang"
(e.g., the simplest "javac HelloWorld.java" will run for hours
and produce no visible result, except for several java processes
reported by "ps").

So, that said, can anyone here comment on a Linux configuration that will
allow us to run the JDK1.1.6 Sparc port on a Sun4c IPX ?

Otherwise, we'll just have to put Solaris back on it.

Cheers -- Gary
[EMAIL PROTECTED]


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: Applet transparency?

1999-10-07 Thread Rachit Siamwalla

Just so you know, the javafaq at www.afu.com claims its impossible. I
have yet to find a mistake in the faq.

-rchit

Dustin Lang wrote:
> 
> Hi,
> 
> > Try setting the background color to null.
> 
> One might suppose that what should happen is that the browser would leave
> the background in its original pristine state, and then unless the applet
> painted itself, that background would stay the way it was.  I think most
> (read: all) browsers paint the applet with some default colour (ugly
> gray?).
> 
> An alternate solution would be for the applet to ask the browser what the
> background looked like originally.  This could/would be done through
> AppletContext.  Alas, such a method does not exist, so you're pretty much
> out of luck, at least in the general case.
> 
> It's important to make the distinction between actually making the applet
> transparent and making it look transparent.  As far as I can see in
> general, the first is not possible, while the second is relatively easy.
> 
> Cheers,
> dstn.
> 
> --
> To UNSUBSCRIBE, email to [EMAIL PROTECTED]
> with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: Java on RedHat 6.1

1999-10-07 Thread Rachel Greenham

Paolo Ciccone wrote:
> 
> On Thu, Oct 07, 1999 at 10:49:58AM -0700, Dan Iuster wrote:
> > RedHat has just released the 6.1 version of Linux.  I am curious if
> > anyone has had any experience with the 1.1.7, 1.1.8 or 1.2 JDK and JRE
> > on RedHat 6.1.  I have some rather large applications to port, and I
> > would like to know if there are any known pitfall introduced by the new
> > kernel.  I believe 6.1 is based on the 2.2.12 kernel.
> 
> I don't know about RH 6.1 but I'm using Mandrake 6.1 with kernel 2.2.13 and
> JDK 1.2 works normally.

Um, I hadn't heard 2.2.13 was out. Are you on a pre?

-- 
Rachel


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Changing the font on Swing slider

1999-10-07 Thread Jacob Nikom

Hi,

I am trying to change the font style and size on some 
of the Swing widgets, mostly JSlider (tick marks numbers), TabbedPanes
(tab names), etc. You cannot not set them up
directly with setFont. 

I could not find any information how to do it. Do you 
have any idea how to do it?

Thank you,

Jacob Nikom


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



"no awt in shared library path"

1999-10-07 Thread Mike Tinnes


I get the following error while trying to run a servlet that utilized the
awt classes.. "no awt in shared library path". I'm using RH6.0, Apache JServ
1.1b1 and jdk117v3. I'm assuming the VM needs the LD_LIBRARY_PATH set to the
awt shared libraries, but how?

TIA, Mike


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: "no awt in shared library path"

1999-10-07 Thread Michael Sinz

On Thu, 7 Oct 1999 19:22:23 -0500, Mike Tinnes wrote:

>
>I get the following error while trying to run a servlet that utilized the
>awt classes.. "no awt in shared library path". I'm using RH6.0, Apache JServ
>1.1b1 and jdk117v3. I'm assuming the VM needs the LD_LIBRARY_PATH set to the
>awt shared libraries, but how?

Actually, this is because you don't have DISPLAY set (thus not within
an X-session) and thus can not make use of AWT which needs X to do its thing.

(This is usually the case when using JServ and you want to do image stuff.
Best to try the Xvfb server and have that set for the JServ session with
DISPLAY set to point at it - mostlikely something like DISPLAY=:2.0 or
whatever display number you start you Xvfb running as.)

-- 
Michael Sinz  Technology and Engineering Director/Consultant
"Starting Startups" mailto:[EMAIL PROTECTED]
My place on the web ---> http://www.users.fast.net/~michael_sinz



--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Help on installing Jserv

1999-10-07 Thread Sudhir Babu

Hello friends,
I am using RedHat 5.2 and jkd 1.1.7 ,and i want help on installing 
Jserv,to run servlets.I tried to install Jserv 1.1 as given in the
readme file and congfigured as specified.But when i run apache server it
tells me that there are errors in jserv.conf.
If i comment the Include statement of jserv.conf ,apache runs properly.
Please help me !
Thank you friends,
Sudhir.


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]