comp.lang.java.programmer
http://groups-beta.google.com/group/comp.lang.java.programmer
[EMAIL PROTECTED]

Today's topics:

* Using the 'this' keyword. - 4 messages, 4 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/a7ab8e9b27d4d517
* pthread_create for class ? - 3 messages, 2 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/72dfa4e7d059c9b5
* JPanel/ScrollBar Bug - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/a03c5546acd5b1de
* applets, applications & beans - 4 messages, 3 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/5eed53393e937afa
* Graphics vs. Graphics2D (was: Graphic2D.setBackground) - 3 messages, 2 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/4af59f17536c70a8
* Delphi to bytecode compiler - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/a0816565f409fd33
* Process.destroy() on Win32 - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/2677bdb23c8cb84b
* RMI: NoSuchObjectException - rectifying - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/1c163fb126731416
* Warning about JFileChooser filters and thread safety - 2 messages, 2 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/3eba891af6a2daa0
* java & java script - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/5bb29439dd2da26d
* jgrasp startup error - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/90e7404357b39172
* Log4j Appender executing ONLY at a given level... - 2 messages, 2 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/8a23033a473933f9
  
==========================================================================
TOPIC: Using the 'this' keyword.
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/a7ab8e9b27d4d517
==========================================================================

== 1 of 4 ==
Date:   Sat,   Aug 28 2004 2:10 am
From: Tor Iver Wilhelmsen <[EMAIL PROTECTED]> 

Jacob <[EMAIL PROTECTED]> writes:

>   void setName (String name)
>   {
>     name_ = name;
>   }

I'd call it an ugly hack to avoid using this. :)



== 2 of 4 ==
Date:   Sat,   Aug 28 2004 2:54 am
From: [EMAIL PROTECTED] (Jonck van der Kogel) 

[EMAIL PROTECTED] (Harry Colquhoun) wrote in message news:<[EMAIL PROTECTED]>...
> For my current job I've encountered a java coding 'technique' in the
> existing code that has me scratching my head.  Most places in the code
> where a method variable is referenced, the previous programmers prefix
> the variable with the "this" keyword (i.e. this.myVariable = 10). 
> Even worse (imho), they've defined their setter methods as follows:
> 
>    setVariableName(String variableName) {
>               this.variableName = variableName;
>    }

When you use the automatic getter/setter generation feature in Eclipse
it also uses this structure, perhaps the programmer before you used
this feature to create the getters/setters.



== 3 of 4 ==
Date:   Sat,   Aug 28 2004 4:32 am
From: "Michael Saunby" <[EMAIL PROTECTED]> 


"Bryce" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]

[snip]

> I agree somewhat. For instance, suppose you had this:
> class SomeClass {
> String  variableName;
>
> setVariableName(String varaibleName) {
>   this.variableName = variableName;
> }
> }
>
> Note the misspelling in the method. Now, I should note that most IDE's
> have a function that generates getters and setters, but trying to
> debug the above handwritten code can be difficult.
>
> Just my 2 cents.
>

Indeed when any compiler fails to warn of unused variable mistakes of this
type soon creep in.  Which prompt me to ask if anyone knows of a Java
compiler that does generate such warnings? Heck I'd be prepared to consider
unused local variables a complilation error, but I expect the language
definition is quite so totalitarian.

Fortunately I use NetRexx to generate Java code most of the time so the
setter problem isn't such a big deal.  See
http://www-306.ibm.com/software/awdtools/netrexx/language/nrsexp.html

e.g. this NetRexx source

class SomeClass
        properties indirect
        variableName=String

Produced this Java -

/* Generated from 'SomeClass.nrx' 28 Aug 2004 12:28:46 [v2.02] */
/* Options: Crossref Decimal Format Java Logo Trace2 Verbose3 */

public class SomeClass{
 private static final java.lang.String $0="SomeClass.nrx";
 /* properties indirect */
 private java.lang.String variableName;

 public java.lang.String getVariableName(){return variableName;}

 public void setVariableName(java.lang.String $1){variableName=$1;return;}

 public SomeClass(){return;}
 }


Michael Saunby






== 4 of 4 ==
Date:   Sat,   Aug 28 2004 8:46 am
From: Paul Lutus <[EMAIL PROTECTED]> 

Michael Saunby wrote:

> 
> "Bryce" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> 
> [snip]
> 
>> I agree somewhat. For instance, suppose you had this:
>> class SomeClass {
>> String  variableName;
>>
>> setVariableName(String varaibleName) {
>>   this.variableName = variableName;
>> }
>> }
>>
>> Note the misspelling in the method. Now, I should note that most IDE's
>> have a function that generates getters and setters, but trying to
>> debug the above handwritten code can be difficult.
>>
>> Just my 2 cents.
>>
> 
> Indeed when any compiler fails to warn of unused variable mistakes of this
> type soon creep in.  Which prompt me to ask if anyone knows of a Java
> compiler that does generate such warnings?

Supposedly the new 1.5 compiler has a "lint" equivalent command-line option
(-Xlint) that will provide a rather strict evaluation of your source code.
I haven't used it yet (I have slow-dial-up, downloads here are
interminable).

-- 
Paul Lutus
http://www.arachnoid.com





==========================================================================
TOPIC: pthread_create for class ?
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/72dfa4e7d059c9b5
==========================================================================

== 1 of 3 ==
Date:   Sat,   Aug 28 2004 2:33 am
From: vertigo <[EMAIL PROTECTED]> 

Hello
I have class Node and function:
void Node::Start(void){
     pthread_create(&ServerLoopThread,NULL,&Node::StartServerLoop,NULL);
}

void Node::StartServerLoop(void){
    ...
}

and durring compilation i receive error:
Node.c: In member function `void Node::Start()':
Node.c:21: error: cannot convert `void (Node::*)()' to `void*(*)(void*)' 
for
    argument `3' to `int pthread_create(pthread_t*, const pthread_attr_t*,
    void*(*)(void*), void*)'
make: *** [Node.o] Error 1

when i changed to:
 
pthread_create(&ServerLoopThread,NULL,(void*(*)(void*))&Node::StartServerLoop,NULL);
i receive error:
Node.c: In member function `void Node::Start()':
Node.c:20: error: converting from `void (Node::*)()' to `void*(*)(void*)'
make: *** [Node.o] Error 1

Why ?
How can i correct it ?

Thanx
Michal




== 2 of 3 ==
Date:   Sat,   Aug 28 2004 2:50 am
From: vertigo <[EMAIL PROTECTED]> 



sorry, i've mistaken groups.




== 3 of 3 ==
Date:   Sat,   Aug 28 2004 2:53 am
From: Paul Lutus <[EMAIL PROTECTED]> 

vertigo wrote:

> Hello
> I have class Node and function:
> void Node::Start(void){
>      pthread_create(&ServerLoopThread,NULL,&Node::StartServerLoop,NULL);
> }
> 
> void Node::StartServerLoop(void){


This is not Java code. Did you just choose a newsgroup at random?

>     ...
> }
> 
> and durring compilation i receive error:
> Node.c: In member function `void Node::Start()':
> Node.c:21: error: cannot convert `void (Node::*)()' to `void*(*)(void*)'
> for
>     argument `3' to `int pthread_create(pthread_t*, const pthread_attr_t*,
>     void*(*)(void*), void*)'
> make: *** [Node.o] Error 1
> 
> when i changed to:
>  
> pthread_create(&ServerLoopThread,NULL,(void*(*
(void*))&Node::StartServerLoop,NULL);
> i receive error:
> Node.c: In member function `void Node::Start()':
> Node.c:20: error: converting from `void (Node::*)()' to `void*(*)(void*)'
> make: *** [Node.o] Error 1
> 
> Why ?
> How can i correct it ?

Well, you can start by posting to an appropriate newsgroup. Your code looks
like C++. I think if you cannot identify which language you are coding in,
it's going to be a long haul between this moment and a working program.

-- 
Paul Lutus
http://www.arachnoid.com





==========================================================================
TOPIC: JPanel/ScrollBar Bug
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/a03c5546acd5b1de
==========================================================================

== 1 of 1 ==
Date:   Sat,   Aug 28 2004 2:52 am
From: Andrew Thompson <[EMAIL PROTECTED]> 

On 27 Aug 2004 11:47:28 -0700, Jenny wrote:

> Thanks.

You're welcome.  

..Did you get the problem fixed?

-- 
Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology




==========================================================================
TOPIC: applets, applications & beans
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/5eed53393e937afa
==========================================================================

== 1 of 4 ==
Date:   Sat,   Aug 28 2004 3:00 am
From: Paul Lutus <[EMAIL PROTECTED]> 

Jeremy Watts wrote:

> am i right in thinking that 'applets' are compiled, and 'applications' are
> interpreted? 

Not remotely.

> i'm reading this confusing book on java and i cant quite get 
> to the difference between the two.

So is it getting cold where you live? If the book tells you that applets are
compiled and applications are interpreted, maybe the book would make nice
kindling.

> i'm in the process of writing a maths program thats to be used within a
> brouser.  now i've used PHP to write it and its taking several minutes to
> run, because PHP is an interpretor, and so slower.

No. There is something seriously wrong with your PHP code if it takes
minutes. PHP is ordinarily quite fast, unless you are doing some heavy-duty
number crunching along the way (or unless your server is too busy to handle
the server-side PHP load).

> so what i need is a 
> compilable language.

What you need is a different book. Java might run faster than the PHP
version, but they are both interpreted, in a manner of speaking, and there
should not be any major difference between them.

Also, a PHP page is run on the server and only the result is sent to the
client, wehereas an applet runs entirely on the client machine.

(pause for thought)

You know, if your server is busy, this would argue in favor of an applet for
a labor-intensive math problem.

Okay, I am going to stop now, this is getting way too hypothetical. You need
to tell us more about the particulars.

-- 
Paul Lutus
http://www.arachnoid.com




== 2 of 4 ==
Date:   Sat,   Aug 28 2004 4:34 am
From: "Jeremy Watts" <[EMAIL PROTECTED]> 


"Paul Lutus" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> Jeremy Watts wrote:
>
>> am i right in thinking that 'applets' are compiled, and 'applications' 
>> are
>> interpreted?
>
> Not remotely.
>
>> i'm reading this confusing book on java and i cant quite get
>> to the difference between the two.
>
> So is it getting cold where you live? If the book tells you that applets 
> are
> compiled and applications are interpreted, maybe the book would make nice
> kindling.
>
>> i'm in the process of writing a maths program thats to be used within a
>> brouser.  now i've used PHP to write it and its taking several minutes to
>> run, because PHP is an interpretor, and so slower.
>
> No. There is something seriously wrong with your PHP code if it takes
> minutes. PHP is ordinarily quite fast, unless you are doing some 
> heavy-duty
> number crunching along the way (or unless your server is too busy to 
> handle
> the server-side PHP load).
>
>> so what i need is a
>> compilable language.
>
> What you need is a different book. Java might run faster than the PHP
> version, but they are both interpreted, in a manner of speaking, and there
> should not be any major difference between them.
>
> Also, a PHP page is run on the server and only the result is sent to the
> client, wehereas an applet runs entirely on the client machine.
>
> (pause for thought)
>
> You know, if your server is busy, this would argue in favor of an applet 
> for
> a labor-intensive math problem.
>
> Okay, I am going to stop now, this is getting way too hypothetical. You 
> need
> to tell us more about the particulars.

hello paul, you used to be a regular on the physics ng giving shead a 
bashing :)  nice to see you again.

yes, the reason that my php programs are taking several minutes to run is 
that for reasons of numerical accuracy i decided to handle the numbers 
symbollically.

php like most languages starts to put numbers in scientific format once they 
reach a certain size, and this was having an effect on some of the 
calculations i was doing, so i decided to write a number of routines that 
did basic arithmetic but treating the numbers as strings.

these routines could handle numbers of any size (well up to the string 
handling limits of php whatever that is), but in doing so they then started 
to make the procedures that relied on them run slowly.  so i guessed if i 
didnt use an interpreted language like php that would speed things up much 
more.  hence my search for a compiled language, or a semi-compiled language 
anyway, brought me to consider java.


>
> -- 
> Paul Lutus
> http://www.arachnoid.com
> 





== 3 of 4 ==
Date:   Sat,   Aug 28 2004 8:53 am
From: Paul Lutus <[EMAIL PROTECTED]> 

Jeremy Watts wrote:

> 
> "Paul Lutus" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>> Jeremy Watts wrote:
>>
>>> am i right in thinking that 'applets' are compiled, and 'applications'
>>> are
>>> interpreted?
>>
>> Not remotely.
>>
>>> i'm reading this confusing book on java and i cant quite get
>>> to the difference between the two.
>>
>> So is it getting cold where you live? If the book tells you that applets
>> are
>> compiled and applications are interpreted, maybe the book would make nice
>> kindling.
>>
>>> i'm in the process of writing a maths program thats to be used within a
>>> brouser.  now i've used PHP to write it and its taking several minutes
>>> to run, because PHP is an interpretor, and so slower.
>>
>> No. There is something seriously wrong with your PHP code if it takes
>> minutes. PHP is ordinarily quite fast, unless you are doing some
>> heavy-duty
>> number crunching along the way (or unless your server is too busy to
>> handle
>> the server-side PHP load).
>>
>>> so what i need is a
>>> compilable language.
>>
>> What you need is a different book. Java might run faster than the PHP
>> version, but they are both interpreted, in a manner of speaking, and
>> there should not be any major difference between them.
>>
>> Also, a PHP page is run on the server and only the result is sent to the
>> client, wehereas an applet runs entirely on the client machine.
>>
>> (pause for thought)
>>
>> You know, if your server is busy, this would argue in favor of an applet
>> for
>> a labor-intensive math problem.
>>
>> Okay, I am going to stop now, this is getting way too hypothetical. You
>> need
>> to tell us more about the particulars.
> 
> hello paul, you used to be a regular on the physics ng giving shead a
> bashing :)  nice to see you again.
> 
> yes, the reason that my php programs are taking several minutes to run is
> that for reasons of numerical accuracy i decided to handle the numbers
> symbollically.

Do you  mean you manipulate equations algebraically a la Mathematica, or do
you mean you numerically process long doubles as text strings, or some
third option? 

> 
> php like most languages starts to put numbers in scientific format once
> they reach a certain size, and this was having an effect on some of the
> calculations i was doing, so i decided to write a number of routines that
> did basic arithmetic but treating the numbers as strings.

There's my answer. This is terribly inefficient, as you must know.

> 
> these routines could handle numbers of any size (well up to the string
> handling limits of php whatever that is), but in doing so they then
> started
> to make the procedures that relied on them run slowly.  so i guessed if i
> didnt use an interpreted language like php that would speed things up much
> more.  hence my search for a compiled language, or a semi-compiled
> language anyway, brought me to consider java.

If you can get your visitors to download an up-to-date Java runtime, then
you can use an applet that has access to more efficient,
arbitrary-precision floating-point packages and solve the problem that way.
Now that I know what you are doing, I can say with confidence that Java's
newer features wil solve this problem much more efficiently than a PHP
hand-coded text string effort to handle long floats. I am saying seconds,
not minutes.

BTW you can also call server-side Linux tools like "bc" from PHP and get the
long-float results that way. This would also be much, much faster than
generating them from PHP directly. This must be done carefully to avoid
some classic pitfalls having to do with invoking a command-line tool using
user-provided strings, but this problem is not a difficult one to deal
with.

In terms of total effort and convenience to your visitors, the second option
may be better overall.

-- 
Paul Lutus
http://www.arachnoid.com




== 4 of 4 ==
Date:   Sat,   Aug 28 2004 12:09 pm
From: "Michael Saunby" <[EMAIL PROTECTED]> 


"Paul Lutus" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]

[snip]

> >
> > php like most languages starts to put numbers in scientific format once
> > they reach a certain size, and this was having an effect on some of the
> > calculations i was doing, so i decided to write a number of routines
that
> > did basic arithmetic but treating the numbers as strings.
>
> There's my answer. This is terribly inefficient, as you must know.
>

And hardly worth writing the code for as it has almost certainly already
been done better by others.  See http://www2.hursley.ibm.com/decimal/

Michael Saunby






==========================================================================
TOPIC: Graphics vs. Graphics2D (was: Graphic2D.setBackground)
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/4af59f17536c70a8
==========================================================================

== 1 of 3 ==
Date:   Sat,   Aug 28 2004 3:06 am
From: [EMAIL PROTECTED] (David Favro) 

A side topic that's bothered me for a long time...

Notice that this code blindly assumes that the Graphics object passed
into paintComponent() is, in fact, a Graphics2D.  Since most
sophisticated drawing is much easier with a Graphics2D than a
Graphics, I usually do the same (except with an explicit instanceof
check, etc.), and it has always worked when running Swing apps under
1.4.  But Sun's documentation, so far as I can tell, never explicitely
says that the Swing run-time environment WILL always use a Graphics2D
for component painting, so...

Does anyone know, when is it safe to assume that component painting
will take place with a Graphics2D?  Is it implementation-specific? 
Where is this documented?  If the answer is "always", then why
wouldn't they use that type to pass in as the parameter to
paintComponent(), etc.?  And if I were passed a Graphics that isn't a
Graphics2D, but I want to do my painting via a Graphics2D, do I have
any options, like an 'adapter' that translates Graphics2D calls and
passes them on to a Graphics?  Should I cross-post this to c.l.j.gui?

Please post replies to the newsgroup -- this e-mail has been heavily
harvested for spam so I cannot pick the real messages out of the
flood.

TIA,
David Favro
[EMAIL PROTECTED]
Meta-Dynamic Solutions, LLC

On 24 Aug 2004 20:28:48 -0700, Jenny <[EMAIL PROTECTED]>
wrote:

> Hi,
>
> Could you tell me why the code comp2D.setBackground(Color.white); does
> not make the color white?  The code comp2D.fillRect(0, 0, 400, 400);
> works.
>
>
> Thank you very much.
>
>
>
> import java.awt.*;
> import javax.swing.*;
> import java.awt.geom.*;
>
> public class Line extends JFrame {
>     public Line() {
>         super("Line");
>         setSize(410, 430);
>         setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
>         LinePanel lp = new LinePanel();
>         Container content = getContentPane();
>         content.add(lp);
>         setContentPane(content);
>         setVisible(true);
>     }
>
>     public static void main(String[] arguments) {
>         Line line = new Line();
>     }
> }
>
> class LinePanel extends JPanel {
>     public void paintComponent(Graphics comp) {
>         super.paintComponent(comp);
>         Graphics2D comp2D = (Graphics2D) comp;
>         comp2D.setBackground(Color.white);
>        // comp2D.fillRect(0, 0, 400, 400);
>       Line2D.Double l1 = new Line2D.Double(10,200,390,200);
>       Line2D.Double l2 = new Line2D.Double(200,10,200,390);
>       BasicStroke pen = new BasicStroke(5F);
>       comp2D.setColor(Color.blue);
>       comp2D.draw(l1);
>       comp2D.draw(l2);
>     }
> }



== 2 of 3 ==
Date:   Sat,   Aug 28 2004 3:06 am
From: [EMAIL PROTECTED] (David Favro) 

A side topic that's bothered me for a long time...

Notice that this code blindly assumes that the Graphics object passed
into paintComponent() is, in fact, a Graphics2D.  Since most
sophisticated drawing is much easier with a Graphics2D than a
Graphics, I usually do the same (except with an explicit instanceof
check, etc.), and it has always worked when running Swing apps under
1.4.  But Sun's documentation, so far as I can tell, never explicitely
says that the Swing run-time environment WILL always use a Graphics2D
for component painting, so...

Does anyone know, when is it safe to assume that component painting
will take place with a Graphics2D?  Is it implementation-specific? 
Where is this documented?  If the answer is "always", then why
wouldn't they use that type to pass in as the parameter to
paintComponent(), etc.?  And if I were passed a Graphics that isn't a
Graphics2D, but I want to do my painting via a Graphics2D, do I have
any options, like an 'adapter' that translates Graphics2D calls and
passes them on to a Graphics?  Should I cross-post this to c.l.j.gui?

Please post replies to the newsgroup -- this e-mail has been heavily
harvested for spam so I cannot pick the real messages out of the
flood.

TIA,
David Favro
[EMAIL PROTECTED]
Meta-Dynamic Solutions, LLC

On 24 Aug 2004 20:28:48 -0700, Jenny <[EMAIL PROTECTED]>
wrote:

> Hi,
>
> Could you tell me why the code comp2D.setBackground(Color.white); does
> not make the color white?  The code comp2D.fillRect(0, 0, 400, 400);
> works.
>
>
> Thank you very much.
>
>
>
> import java.awt.*;
> import javax.swing.*;
> import java.awt.geom.*;
>
> public class Line extends JFrame {
>     public Line() {
>         super("Line");
>         setSize(410, 430);
>         setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
>         LinePanel lp = new LinePanel();
>         Container content = getContentPane();
>         content.add(lp);
>         setContentPane(content);
>         setVisible(true);
>     }
>
>     public static void main(String[] arguments) {
>         Line line = new Line();
>     }
> }
>
> class LinePanel extends JPanel {
>     public void paintComponent(Graphics comp) {
>         super.paintComponent(comp);
>         Graphics2D comp2D = (Graphics2D) comp;
>         comp2D.setBackground(Color.white);
>        // comp2D.fillRect(0, 0, 400, 400);
>       Line2D.Double l1 = new Line2D.Double(10,200,390,200);
>       Line2D.Double l2 = new Line2D.Double(200,10,200,390);
>       BasicStroke pen = new BasicStroke(5F);
>       comp2D.setColor(Color.blue);
>       comp2D.draw(l1);
>       comp2D.draw(l2);
>     }
> }



== 3 of 3 ==
Date:   Sat,   Aug 28 2004 9:13 am
From: Paul Lutus <[EMAIL PROTECTED]> 

David Favro wrote:

> A side topic that's bothered me for a long time...
> 
> Notice that this code blindly assumes that the Graphics object passed
> into paintComponent() is, in fact, a Graphics2D.

The cast is quite benign, and when it isn't, the compiler will complain
about it.

-- 
Paul Lutus
http://www.arachnoid.com





==========================================================================
TOPIC: Delphi to bytecode compiler
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/a0816565f409fd33
==========================================================================

== 1 of 1 ==
Date:   Sat,   Aug 28 2004 3:37 am
From: Kai Thomsen <[EMAIL PROTECTED]> 

A couple of years ago Borland actually developed a prototype of a
Delphi->Java Bytecode compiler. But as far as I remember they never got
beyond console applications and considered the effort of translating VCL
code to Swing as too much. You could google the Borland newsgroups for
information about this project.

Kai

Jonathan Neve wrote:

> Hi all!
> 
> I'm wondering what would be involved in making a Delphi to bytecode
> compiler... Does anyone have any experience writing compilers, that
> could give me some advice?
> 
> The reason I think this would be useful, is that it would broaden the
> scope of the Java platform, enabling many languages to be used (just
> like .NET). There are already several langages (e.g. Java, Jython,
> Groovy, and perhaps others), but it would be nice to have a language as
> close as possible to Delphi syntax that could likewise compile into
> bytecode. This would greatly facilitate converting projects from Delphi
> to Java.
> 
> Any ideas?
> 
> Thanks!
> Joanthan Neve.





==========================================================================
TOPIC: Process.destroy() on Win32
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/2677bdb23c8cb84b
==========================================================================

== 1 of 1 ==
Date:   Sat,   Aug 28 2004 4:01 am
From: "Matt Humphrey" <[EMAIL PROTECTED]> 


"Joshua Jones" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Running on Win2k.  I have something like this:
>
> AntThread.java
> ==============
> Process p;
> try {
>     p = Runtime.getRuntime().exec(commandLine);
>     ...
>     p.waitFor();
> }
> ...
> catch (InterruptedException e) {
>     p.destroy();
>     p = null;
> }
> finally {
>     cleanup();
> }
> ==============
>
> Another thread calls AntThread's interrupt() method, and I get to the
> InterruptedException catch block.  For some reason, however, this
> process (an ant build process, which itself uses java) does not end.
> I continue getting output from it, and only if I kill the process
> manually through the task manager will it stop.
>
> I can't get the PID from Java or anywhere else, which would be kludgy
> anyway.  Does anyone know why the destroy() method is not destroying,
> or better yet, a solution?

Does your command line program generate output?  If it produces output on
stdout or stderr and you do not actually read that output, the process will
block waiting for you to read it.  The output is not automatically consumed,
but fills up a buffer and when it gets full (1K or so) the process will
block.  The standard solution is to initiate two threads that consume the
process's output--you can find it in a google search.

Cheers,
Matt Humphrey  [EMAIL PROTECTED]   http://www.iviz.com/






==========================================================================
TOPIC: RMI: NoSuchObjectException - rectifying
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/1c163fb126731416
==========================================================================

== 1 of 1 ==
Date:   Sat,   Aug 28 2004 7:15 am
From: "VisionSet" <[EMAIL PROTECTED]> 

When my app starts it looks up the remote object, it doesn't do that again.

If the connection is dropped then I obviously get a NoSuchObjectException
for remote calls.

Is there any way to listen for the connection being dropped so I can attempt
to re-lookup my object?

I naturally catch all remote exceptions and I could obviously intercept the
NSOE there, but is there a cleaner way?

-- 
Mike W






==========================================================================
TOPIC: Warning about JFileChooser filters and thread safety
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/3eba891af6a2daa0
==========================================================================

== 1 of 2 ==
Date:   Sat,   Aug 28 2004 10:48 am
From: "Larry Barowski" <larrybarATengDOTauburnDOTeduANDthatISall> 


"Liz" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
> "Larry Barowski" <larrybarATengDOTauburnDOTeduANDthatISall> wrote in
message
> news:[EMAIL PROTECTED]
> > > Maybe I am confused, but isn't there a different instance of
"accept()"
> > > for each FileFilter?
> >
> > Sure, but you can add one FileFilter instance to more than one
> > JFileChooser, and each JFileChooser will start a separate thread
> > to do the filtering. In that case, accept() itself would need to be
> > thread-safe.
>
> Wow, lots of info in this message. Let me see, I have a simple GUI
> with a single button that brings up the file chooser. If the file
> chooser is open and I try to click the button again, I get some sort
> of bell and it refuses to open a second file chooser. In fact, I cannot
> click any buttons without getting the bell.

So the gui designer used a modal dialog - that is not a
requirement. I have a gui where I can open one "Open",
one "Save As", one "Backup As", one "Print to File",
and one of various other accessory dialogs that use file
choosers, for each open editing window; one global
"Open File" dialog, one global "Multiple File Search"
dialog, etc. None of these dialogs are modal, so you
could have thousands of active JFileChoosers going at
once.

Making file chooser dialogs (or any dialogs) modal
when they don't have to be is lazy design in my opinion
Nothing should be modal unless it requires immediate
attention. It may take more work to make them
modeless, but the result is a more usable interface.






== 2 of 2 ==
Date:   Sat,   Aug 28 2004 11:54 am
From: "Liz" <[EMAIL PROTECTED]> 


"Larry Barowski" <larrybarATengDOTauburnDOTeduANDthatISall> wrote in message
news:[EMAIL PROTECTED]
>
> "Liz" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> >
> > "Larry Barowski" <larrybarATengDOTauburnDOTeduANDthatISall> wrote in
> message
> > news:[EMAIL PROTECTED]
> > > > Maybe I am confused, but isn't there a different instance of
> "accept()"
> > > > for each FileFilter?
> > >
> > > Sure, but you can add one FileFilter instance to more than one
> > > JFileChooser, and each JFileChooser will start a separate thread
> > > to do the filtering. In that case, accept() itself would need to be
> > > thread-safe.
> >
> > Wow, lots of info in this message. Let me see, I have a simple GUI
> > with a single button that brings up the file chooser. If the file
> > chooser is open and I try to click the button again, I get some sort
> > of bell and it refuses to open a second file chooser. In fact, I cannot
> > click any buttons without getting the bell.
>
> So the gui designer used a modal dialog - that is not a
> requirement. I have a gui where I can open one "Open",
> one "Save As", one "Backup As", one "Print to File",
> and one of various other accessory dialogs that use file
> choosers, for each open editing window; one global
> "Open File" dialog, one global "Multiple File Search"
> dialog, etc. None of these dialogs are modal, so you
> could have thousands of active JFileChoosers going at
> once.

So where do you put 1000 popup dialogs so you can see them all????

>
> Making file chooser dialogs (or any dialogs) modal
> when they don't have to be is lazy design in my opinion
> Nothing should be modal unless it requires immediate
> attention. It may take more work to make them
> modeless, but the result is a more usable interface.
>
>
>






==========================================================================
TOPIC: java & java script
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/5bb29439dd2da26d
==========================================================================

== 1 of 1 ==
Date:   Sat,   Aug 28 2004 10:41 am
From: Michael Borgwardt <[EMAIL PROTECTED]> 

Hal Rosser wrote:
>>- Both are object oriented
> 
> ********************************
> ***Actually - JavaScript is object-based - rather than object-oriented  -
> but they try


"object-based" is not a technical term related to programming languages.
"object-oriented" is, and Javascript is most definitely object-oriented.
What you probably meant is that, unlike java, Javascript's object
orientation is prototype-based instead of class-based. But that doesn't
meant it's "less" object-oriented.




==========================================================================
TOPIC: jgrasp startup error
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/90e7404357b39172
==========================================================================

== 1 of 1 ==
Date:   Sat,   Aug 28 2004 11:58 am
From: "Larry Barowski" <larrybarATengDOTauburnDOTeduANDthatISall> 

> Hey! Wait a minute - you WROTE JGrasp - I bow to your expertise. - sorry

No apology necessary. As I said, the OP probably
does want to compile Java. We just don't want people
to get the idea that jGRASP is an IDE for Java only.
The "j" doesn't help, but it would probably be counter-
productive to change the name at this point.






==========================================================================
TOPIC: Log4j Appender executing ONLY at a given level...
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/8a23033a473933f9
==========================================================================

== 1 of 2 ==
Date:   Sat,   Aug 28 2004 11:50 am
From: [EMAIL PROTECTED] (schmen) 

Is there a way to provide a log4j configuration that provides a
stipulation that a given appender executes ONLY at a given priority
level.  For example, I have an SMTP appender that I would like to
execute only at the level of ERROR; and not at any of the lower
levels.

Currently, I have a decorator class to swap the appender in and out
depending on the level being invoked.   Further, I plan on migrating
to the commons-logger project, that is why I would like for a solution
to be on the configuration side of things.

Any ideas would be appreciated.



== 2 of 2 ==
Date:   Sat,   Aug 28 2004 11:56 am
From: "David Hilsee" <[EMAIL PROTECTED]> 

"schmen" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Is there a way to provide a log4j configuration that provides a
> stipulation that a given appender executes ONLY at a given priority
> level.  For example, I have an SMTP appender that I would like to
> execute only at the level of ERROR; and not at any of the lower
> levels.
>
> Currently, I have a decorator class to swap the appender in and out
> depending on the level being invoked.   Further, I plan on migrating
> to the commons-logger project, that is why I would like for a solution
> to be on the configuration side of things.
>
> Any ideas would be appreciated.

Using the XML config file, you can specify filters so your logs only contain
certain levels.  It sounds like you need to look at the LevelRangeFilter and
LevelMatchFilter.  Google provides some examples of this (e.g.
http://www.mail-archive.com/[EMAIL PROTECTED]/msg10238.html).
Is this what you want?

-- 
David Hilsee





=======================================================================

You received this message because you are subscribed to the
Google Groups "comp.lang.java.programmer".  

comp.lang.java.programmer
[EMAIL PROTECTED]

Change your subscription type & other preferences:
* click http://groups-beta.google.com/group/comp.lang.java.programmer/prefs

Report abuse:
* send email explaining the problem to [EMAIL PROTECTED]

Unsubscribe:
* click http://groups-beta.google.com/group/comp.lang.java.programmer/subscribe


=======================================================================
Google Groups: http://groups-beta.google.com 



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/BCfwlB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/kumpulan/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 

Reply via email to