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

Today's topics:

* Tomcat and classloaders - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/9d1677b8e903332e
* simpleDateFormat and April month - 2 messages, 2 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/383df9c88dcb10ba
* update doesnt´t work ? - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/3619d270a4e29711
* Java trick - 5 messages, 5 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/bfd25be52dc6a3ad
* J2ME Regular Expressions - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/6e182702e3f20a35
* Test my J2ME MIDP 2.0 game: Taleban vs. Robot - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/d33c48591b2afae1
* what is the difference between j2ee and j2se - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/363ad64739aa166c
* retrieve Data from internet. - 3 messages, 3 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/c7751432bbbfc06
* Help: Inconsistent results of org.w3c.dom-based code evoked from different programs 
- 2 messages, 2 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/2b4b6e41c6c1ec6
* commons validator without struts - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/8b3d4ec3736d40e4
* Undo - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/7434631ea0c81ec8
* chat client alpha version - 2 messages, 2 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/7b0e616eb35b4b1f
* what u program? - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/ee20f99e67fd5410
* java.io.FileReader and java.io.FileWriter encoding - 2 messages, 2 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/48b32bb0299455e8
* How can I save the "http response header",like=>Etag: "28094e" - 2 messages, 2 
authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/7ce0d10cbfea9793
* test if the string is a blank data string - 3 messages, 2 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/681d0b9bedeb1d23
* JNI and threads - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/3507a5e81272b473
* html:img with a dynamic value STRUTS - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/8307d0b6770ca5f3
  
==========================================================================
TOPIC: Tomcat and classloaders
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/9d1677b8e903332e
==========================================================================

== 1 of 1 ==
Date:   Fri,   Sep 17 2004 6:04 am
From: Babu Kalakrishnan <[EMAIL PROTECTED]> 

Erik Berglund wrote:
> Babu Kalakrishnan <[EMAIL PROTECTED]> wrote in message 
>>
>>In such a scenario, the only workaround that I can see is to run 
>>multiple instances of Tomcat (and bind them to different AJP connector 
>>ports if they are on the same physical machine) so that each process 
>>runs under its own private JVM (might be pretty resource intensive if 
>>done on a single machine)
>>
> 
> 
> Yepp, this works great ! Just defining a CATALINA_BASE for each user
> (country) then each country has its own configuration file :-) I had
> to fiddle around with the ports for the connectors and the server port
> as well to prevent bringing down wrong instance when stopping. 

Glad that you managed to solve your immediate problem. But it might 
still be worthwhile to modify your codebase as well wherein you don't 
rely on the default TimeZone property and construct class instances with 
explicit Timezones specified. That approach would be much cleaner and 
would allow you to run multiple webapps under a single Tomcat instance.

BK




==========================================================================
TOPIC: simpleDateFormat and April month
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/383df9c88dcb10ba
==========================================================================

== 1 of 2 ==
Date:   Fri,   Sep 17 2004 6:09 am
From: Sudsy <[EMAIL PROTECTED]> 

Nurettin Arslankaya wrote:
> Hi, 
> here is the all code and execution result :
<snip>
> /* Execution result                             */
> /* -------------------------------------------- */
> /*
> 
> Testing Dateformatter 
> ----------------------
> 1980-04-01 01:00:00
> 1975-04-12 01:00:00
> 
> */

My results:

Testing Dateformatter
----------------------
1980-04-01 00:00:00
1975-04-12 00:00:00

So it would certainly seem to be something to do with your environment.
I note the package directive at the top of your code. Is it possible
that you've got a "stale" version sitting somewhere in your CLASSPATH?
BTW I'm running Java 1.4.2_02 under Linux.




== 2 of 2 ==
Date:   Fri,   Sep 17 2004 8:59 am
From: Paul Lutus <[EMAIL PROTECTED]> 

Nurettin Arslankaya wrote:

> Hi,
> here is the all code and execution result :

/ ... snip code, thanks for posting it.

> /* Execution result                             */
> /* -------------------------------------------- */
> /*
> 
> Testing Dateformatter
> ----------------------
> 1980-04-01 01:00:00
> 1975-04-12 01:00:00
> 
> */

I compiled and ran your code, here is my result:

Testing Dateformatter
----------------------
1980-04-01 00:00:00
1975-04-12 00:00:00

I think there is something wrong with your environment. BTW, you are
throwing away any error messages that may be printed by your code. Very bad
idea. Do this instead:

      catch (Exception ex) {
         ex.printStackTrace();
      }


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





==========================================================================
TOPIC: update doesnt´t work ?
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/3619d270a4e29711
==========================================================================

== 1 of 1 ==
Date:   Fri,   Sep 17 2004 6:23 am
From: Babu Kalakrishnan <[EMAIL PROTECTED]> 

gzell wrote:
> Hi,
> My JFrame holds a JPanel. This JPanel holds an instance
> from a class which is extended from Canvas.
> 
> Because I did´nt wont to clear the drawings on this
> canvas-area I added a method update(Graphics g) which
> only calls paint(g). 
> But everytime, when I call repaint(), my canvas-area first
> get´s a "clear screen" . Is there anyone who knows why ?
> 

Probably because the paint() method of the canvas derived component 
clears the drawing surface before painting the contents ? (As is very 
commonly done)

BK




==========================================================================
TOPIC: Java trick
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/bfd25be52dc6a3ad
==========================================================================

== 1 of 5 ==
Date:   Fri,   Sep 17 2004 6:42 am
From: "Adam" <[EMAIL PROTECTED]> 

You are not referencing 'this' which is null,
so it works fine, even if looks ugly.

In C++ this is even worse:

class CSomeClass
{
    public:
    void foo(){ printf("My 'this' can be null, I dont care!!!"); }
}

....
CSomeClass* pointer;
pointer->foo();
....

This will compile and run correctly,
even though foo() is not static.

Adam 





== 2 of 5 ==
Date:   Fri,   Sep 17 2004 8:33 am
From: "andreas" <[EMAIL PROTECTED]> 

> Yes, we're all aware of this. IMHO it's a nasty kludge that only serves
> to confuse people. The people who designed Java and wrote the JLS must
> have been smoking some pretty heavy stuff when they allowed this.
>

IMHO this behaviour is very consistent.
since a object can be null at any time and the method returns
an object of type CDummy the returned value is

null of type CDummy. therefore the static variable is accessable.

andreas 





== 3 of 5 ==
Date:   Fri,   Sep 17 2004 8:52 am
From: Chris Smith <[EMAIL PROTECTED]> 

andreas wrote:
> IMHO this behaviour is very consistent.
> since a object can be null at any time and the method returns
> an object of type CDummy the returned value is
> 
> null of type CDummy. therefore the static variable is accessable.

I'm trying to understand what you mean, and I'm having trouble.  My 
trouble starts when you say "a object can be null at any time".  In 
fact, an object can't be null, ever.  In fact, 'null' means that no 
object exists.  It's a placeholder value for a reference that does not 
point to an object.

The ugliness of this example isn't that the reference is null when the 
variable is accessed; it's that the static variable can be accessed 
through a reference in the first place.  Since there's no clear meaning 
to using a static variable through a reference at all, it's pointless to 
talk about whether or not it's consistent to allow access through a null 
reference.  At that point, you've just gotta abandon "consistent" and 
read the JLS with a fine-toothed comb.

-- 
www.designacourse.com
The Easiest Way to Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation



== 4 of 5 ==
Date:   Fri,   Sep 17 2004 9:03 am
From: Brian <[EMAIL PROTECTED]> 

Chris Smith <[EMAIL PROTECTED]> wrote:
> The ugliness of this example isn't that the reference is null when the 
> variable is accessed; it's that the static variable can be accessed 
> through a reference in the first place.  Since there's no clear meaning 
> to using a static variable through a reference at all, it's pointless to 
> talk about whether or not it's consistent to allow access through a null 
> reference.  At that point, you've just gotta abandon "consistent" and 
> read the JLS with a fine-toothed comb.

[novice here]

So using static members and methods via references /could/ be disallowed 
with no ill effects?  

  



== 5 of 5 ==
Date:   Fri,   Sep 17 2004 9:03 am
From: Joona I Palaste <[EMAIL PROTECTED]> 

Brian <[EMAIL PROTECTED]> scribbled the following:
> Chris Smith <[EMAIL PROTECTED]> wrote:
>> The ugliness of this example isn't that the reference is null when the 
>> variable is accessed; it's that the static variable can be accessed 
>> through a reference in the first place.  Since there's no clear meaning 
>> to using a static variable through a reference at all, it's pointless to 
>> talk about whether or not it's consistent to allow access through a null 
>> reference.  At that point, you've just gotta abandon "consistent" and 
>> read the JLS with a fine-toothed comb.

> [novice here]

> So using static members and methods via references /could/ be disallowed 
> with no ill effects?  

Yes. It's just syntactic sugar for accessing them via class names, as
only the type of the reference matters, not its value.

-- 
/-- Joona Palaste ([EMAIL PROTECTED]) ------------- Finland --------\
\-- http://www.helsinki.fi/~palaste --------------------- rules! --------/
"And according to Occam's Toothbrush, we only need to optimise the most frequent
instructions."
   - Teemu Kerola




==========================================================================
TOPIC: J2ME Regular Expressions
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/6e182702e3f20a35
==========================================================================

== 1 of 1 ==
Date:   Fri,   Sep 17 2004 6:55 am
From: Andrew Thompson <[EMAIL PROTECTED]> 

On Fri, 17 Sep 2004 13:48:45 +0100, bugbear wrote:

>> ..hmmm.  Those 42,900 hits look interesting,
>> but I think these 798 might be more topical
>> <http://www.google.com/search?q=%22regular+expression%22+package+j2me>
> 
> Granted on total hits, but google is a *ranking* search Engine
> and the 4th and 5th hits (conveniently located on the first
> page of Google's response) seem to perfectly answer the question.

(chuckle) It's not often I am accused 
of making it *too* easy.    ;-)

-- 
Andrew Thompson
http://www.PhySci.org/codes/  Web & IT Help
http://www.PhySci.org/  Open-source software suite
http://www.1point1C.org/  Science & Technology
http://www.lensescapes.com/  Images that escape the mundane




==========================================================================
TOPIC: Test my J2ME MIDP 2.0 game: Taleban vs. Robot
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/d33c48591b2afae1
==========================================================================

== 1 of 1 ==
Date:   Fri,   Sep 17 2004 7:01 am
From: "Christian Hvid" <[EMAIL PROTECTED]> 

I think I found the bug that caused that. (A method called from the game had
a float in its signature causing "ALERT: Bad method signature"). For reason
it did not manifest itself on the S/E K700. The game runs on the Nokia 6600
emulator now.

I have updated the web page with a shorter demo url:

http://apelab.com/d/taleban.jad

Making it easier to type.

Please try again :-D

"daniel" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I tried downloading the game on a Nokia 6600 but it didn't work.  It
> started downloading the app and then it said:
>
> "Unable to install. Invalid version"
>
> [EMAIL PROTECTED] (Christian Hvid) wrote in message
news:<[EMAIL PROTECTED]>...
> > Please test my new mobile phone game:
> >
> > http://apelab.com/mobile/taleban
> >
> > Click "get demo". The full game is not available for sale yet.
> >
> > The game is designed for the Sony Ericsson K700 but should run on any
> > J2ME MIDP 2.0 enabled phone with a minimal display size of 128x128 (or
> > at least so I hope).
> >
> > If you test the demo on a device other the listed devices (currently
> > it is only tested on the Sony Ericsson K700) and you like the game,
> > then I will send you the full version for free (just throw me an email
> > with the name of your device) ...
> >
> > I hope to sell it online :-D but I will release the source code later
> > as a part of a mobile edition of my framework for small java games.
> > The original game and framework is described here:
> >
> > http://vredungmand.dk/programming/sjg/taleban/index.html
> >
> > -- Christian






==========================================================================
TOPIC: what is the difference between j2ee and j2se
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/363ad64739aa166c
==========================================================================

== 1 of 1 ==
Date:   Fri,   Sep 17 2004 7:05 am
From: [EMAIL PROTECTED] (Kevin) 

There is really no "real" difference.  J2EE adds a bunch of garbage
that Sun thinks is "enterprise" like EJB and useless junks like that. 
It's stupid in my opinion.  Java is Java, we don't need to
differentiate and add more buzzwords.  The point is, if it does not
have the word "Enterprise" in it, the morons at Sun thinks it's not a
good marketing hype.

[EMAIL PROTECTED] (Bob) wrote in message news:<[EMAIL PROTECTED]>...
> can someone please explain to me the difference between J2ee and j2se?
> 
> what is meant by enterprise application?
> 
> 
> regds,
> bob




==========================================================================
TOPIC: retrieve Data from internet.
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/c7751432bbbfc06
==========================================================================

== 1 of 3 ==
Date:   Fri,   Sep 17 2004 7:27 am
From: "Philip Chua" <[EMAIL PROTECTED]> 

Hi,

I'm new in java, not sure whether can I look for the source code or a 
solution from someone on retrieving data from internet, like yahoo news or 
stock market.

is that java so powerful?

curious about the java function.

Best Regards
Philip Chua 





== 2 of 3 ==
Date:   Fri,   Sep 17 2004 7:52 am
From: Andrew Thompson <[EMAIL PROTECTED]> 

On Fri, 17 Sep 2004 10:27:58 -0400, Philip Chua wrote:

> I'm new in java, 

<http://www.physci.org/codes/javafaq.jsp#cljh>

>..not sure whether can I look for the source code or a ..

I cannot answer that.  Do you Google?
Try these on for size..
<http://www.google.com/search?q=java+source+%22retrieve+url%22>
<http://www.google.com/search?q=java+source+%22fetch+url%22>

> solution from someone on retrieving data from internet, like yahoo news or 
> stock market.
> 
> is that java so powerful?

Yes.

-- 
Andrew Thompson
http://www.PhySci.org/codes/  Web & IT Help
http://www.PhySci.org/  Open-source software suite
http://www.1point1C.org/  Science & Technology
http://www.lensescapes.com/  Images that escape the mundane



== 3 of 3 ==
Date:   Fri,   Sep 17 2004 8:12 am
From: "andreas" <[EMAIL PROTECTED]> 

yes, java is so powerful.
maybe you refer to some type of browser to read information directly from
a specific site and present it customed.

have a look at this:
http://www.beanshell.org/examples/browser.html

it is a simple browser written in java.

andreas

"Philip Chua" <[EMAIL PROTECTED]> schrieb im Newsbeitrag 
news:[EMAIL PROTECTED]
> Hi,
>
> I'm new in java, not sure whether can I look for the source code or a 
> solution from someone on retrieving data from internet, like yahoo news or 
> stock market.
>
> is that java so powerful?
>
> curious about the java function.
>
> Best Regards
> Philip Chua
> 






==========================================================================
TOPIC: Help: Inconsistent results of org.w3c.dom-based code evoked from different 
programs
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/2b4b6e41c6c1ec6
==========================================================================

== 1 of 2 ==
Date:   Fri,   Sep 17 2004 7:36 am
From: [EMAIL PROTECTED] (Bryan) 

Hi there,

I ran into a kind of strange behavior of Java code. Maybe the reason
is obvious but I cannot figure it out ...

Suppose I have a xml file and from the field "<footag>bar
text</footag>" I simply want to extract "bar text". The following is
my code:

/**************************/
import org.w3c.dom.*;
.
.
.

String text;
Node textFieldNode; 
.
.
. //textFieldNode now points to the field.

//code A:
NodeList myLs = textFieldNode.getChildNodes();
for (int ii = 0; ii < myLs.getLength(); ii++) {
   if (myLs.item(ii) instanceof Text)
   text = myLs.item(ii).getNodeValue();
}

//code B:
text=textFieldNode.toString().replaceAll("<[/]*"+"footag"+">","");
.
.
.
/**********end of code********/

The problem is: Both code A and B generate the right result ("bar
text") when I test it. But when I include this class into a .jar file
and try to call it from within another package, code A generates,
still, the right result but code B assigns "[footage: null]" to text.
Just keen to know why the code works so differently.

Thanks in advance!

Regards,
Bryan



== 2 of 2 ==
Date:   Fri,   Sep 17 2004 9:09 am
From: "xarax" <[EMAIL PROTECTED]> 

"Bryan" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi there,
>
> I ran into a kind of strange behavior of Java code. Maybe the reason
> is obvious but I cannot figure it out ...
>
> Suppose I have a xml file and from the field "<footag>bar
> text</footag>" I simply want to extract "bar text". The following is
> my code:
>
> /**************************/
> import org.w3c.dom.*;
> .
> .
> .
>
> String text;
> Node textFieldNode;
> .
> .
> . //textFieldNode now points to the field.
>
> //code A:
> NodeList myLs = textFieldNode.getChildNodes();
> for (int ii = 0; ii < myLs.getLength(); ii++) {
>    if (myLs.item(ii) instanceof Text)
>    text = myLs.item(ii).getNodeValue();
> }
>
> //code B:
> text=textFieldNode.toString().replaceAll("<[/]*"+"footag"+">","");
> .
> .
> .
> /**********end of code********/
>
> The problem is: Both code A and B generate the right result ("bar
> text") when I test it. But when I include this class into a .jar file
> and try to call it from within another package, code A generates,
> still, the right result but code B assigns "[footage: null]" to text.

You wrote "footage", instead of "footag".

> Just keen to know why the code works so differently.
>
> Thanks in advance!
>
> Regards,
> Bryan






==========================================================================
TOPIC: commons validator without struts
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/8b3d4ec3736d40e4
==========================================================================

== 1 of 1 ==
Date:   Fri,   Sep 17 2004 7:37 am
From: [EMAIL PROTECTED] (Mark Mersereau) 

Hi Ricardo,

Ricardo Trindade <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>...
> Hi,
> 
>       I' having troubles using commons-validator (latest release, also tried
> today's snapshot) without struts.
> 
>       Specifically I tried the code in CVS that can be reached through the FAQ
> item :
>       http://wiki.apache.org/jakarta-commons/ValidatorStandalone
> 
>       I couldn't understand why this examples uses Validators from the test
> package, instead of using, for example, GenericValidator. I tried to change
> the example to use GenericValidator, but validating my bean always fails.
> 
> [snip]

I got this example to work by 

1. Moving a couple methods from
org.apache.struts.validator.FieldChecks to my own
org.apache.commons.validator.example.TestValidator class

2. Adjusting the class and method names in the validator-example.xml
to match my TestValidator class:

-----------------------------------------------------------------------------
package org.apache.commons.validator.example;

import org.apache.commons.validator.Field;
import org.apache.commons.validator.GenericTypeValidator;
import org.apache.commons.validator.GenericValidator;
import org.apache.commons.validator.ValidatorAction;
import org.apache.commons.validator.util.ValidatorUtils;

/**
 * @author mmersereau
 *
 * To change this generated comment edit the template variable
"typecomment":
 * Window>Preferences>Java>Templates.
 * To enable and disable the creation of type comments go to
 * Window>Preferences>Java>Code Generation.
 */
public class TestValidator {

    public static boolean validateRequired(Object bean, Field field)
    {

        String value = null;
        if (isString(bean)) {
            value = (String) bean;
        } else {
            value = ValidatorUtils.getValueAsString(bean,
field.getProperty());
        }

        if (GenericValidator.isBlankOrNull(value)) {
            return false;
        } else {
            return true;
        }

    }
    
    public static Integer validateInteger(Object bean, Field field)
        {
        Integer result = null;
        String value = null;
        if (isString(bean)) {
            value = (String) bean;
        } else {
            value = ValidatorUtils.getValueAsString(bean,
field.getProperty());
        }

        if (!GenericValidator.isBlankOrNull(value)) {
            result = GenericTypeValidator.formatInt(value);
        }

        return result;
    }
    
    protected static boolean isString(Object o) {
        return (o == null) ? true : String.class.isInstance(o);
    }
}
-----------------------------------------------------------------------------
       .
       .
       .
      <validator name="int"
                 classname="org.apache.commons.validator.example.TestValidator"
                 method="validateInteger"
                 methodParams="java.lang.Object,org.apache.commons.validator.Field"
                 msg="errors.int"/>

      <validator name="required"
                 classname="org.apache.commons.validator.example.TestValidator"
                 method="validateRequired"
                 methodParams="java.lang.Object,org.apache.commons.validator.Field"
                 msg="errors.required"/>
                 .
                 .
                 .
-----------------------------------------------------------------------------

Good luck!

  -- Mark




==========================================================================
TOPIC: Undo
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/7434631ea0c81ec8
==========================================================================

== 1 of 1 ==
Date:   Fri,   Sep 17 2004 7:45 am
From: "Adam" <[EMAIL PROTECTED]> 

Thomas & Thomas,
many thanks for the links.

As I've skimmed the materials,
it seems to me that... I don't know
if the framework is suitable for my needs.

Operations which I perform in my application
(and want to be able to undo) have nothing
to do with text or GUI in general.

It's more like that I have an object of a 'business' class:

SomeClass
{
    private int state;
    public void setState(int newState)
    {
        state = newState;
        //code here to notify UndoManager about the change
    }
}

I would like to report each call to setState() to
my UndoManager, and if then user presses undo button,
I would like the UndoManager to restore the previuos
state of the object.
I'm wondering if these requirements are too general
to be implemented with swing.undo, am I wrong?

Before I came across swing.undo package I tried to
design my own framework for that, it looks more or less like this:

interface UndoAble
{
    void undo() throws CantUndoException;
}

class UndoManager
{
    undoLastAction();//called by the GUI when user clicks undo button
    addUndoAction(UndoAble action);
}

For each class (like SomeClass) i have a corresponding class
implementing  UndoAble interface, which is instantiated when
setState is called and passed to UndoManager.addUndoAction().
Each implementation of UndoAble knows exactly how to
restore the state of its corresponding 'business' class.

The problem is that I have so many of these classes.

So I was wondering if using swing.undo would make my life easier
in any way here.

Any opinions?

Adam






==========================================================================
TOPIC: chat client alpha version
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/7b0e616eb35b4b1f
==========================================================================

== 1 of 2 ==
Date:   Fri,   Sep 17 2004 7:48 am
From: "andreas" <[EMAIL PROTECTED]> 

i am sorry, i did not know where to post it so i asked for
inputs on the gui specifically in comp.lang.java.gui and for general
input on the program here. maybe there is a more
adequate newsgroup for my purpose?

andreas

"Andrew Thompson" <[EMAIL PROTECTED]> schrieb im Newsbeitrag 
news:[EMAIL PROTECTED]
> On Thu, 16 Sep 2004 23:08:28 +0200, andreas wrote:
>
>> i wrote a chat client and just finished an alpha-version.
>
> Please refrain from multi-posting, andreas.
> <http://www.physci.org/codes/javafaq.jsp#xpost>
>
> -- 
> Andrew Thompson
> http://www.PhySci.org/codes/  Web & IT Help
> http://www.PhySci.org/  Open-source software suite
> http://www.1point1C.org/  Science & Technology
> http://www.lensescapes.com/  Images that escape the mundane 





== 2 of 2 ==
Date:   Fri,   Sep 17 2004 8:19 am
From: Andrew Thompson <[EMAIL PROTECTED]> 

On Fri, 17 Sep 2004 16:48:01 +0200, andreas wrote:

> i am sorry, i did not know where to post it so i asked for
> inputs on the gui specifically in comp.lang.java.gui and for general
> input on the program here.

Now I look closely at both posts I realize there 
are differences I missed at first, and can now 
understand why you chose to make separate posts.

My bad.  My apologies for suggesting you multi-posted.

( Best of luck with it. )

-- 
Andrew Thompson
http://www.PhySci.org/codes/  Web & IT Help
http://www.PhySci.org/  Open-source software suite
http://www.1point1C.org/  Science & Technology
http://www.lensescapes.com/  Images that escape the mundane




==========================================================================
TOPIC: what u program?
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/ee20f99e67fd5410
==========================================================================

== 1 of 1 ==
Date:   Fri,   Sep 17 2004 7:58 am
From: "andreas" <[EMAIL PROTECTED]> 

well,
network applications mainly
also programs with a gui.

for fast programs, there is no way around c/assembly

andreas

"jaYPee" <[EMAIL PROTECTED]> schrieb im Newsbeitrag 
news:[EMAIL PROTECTED]
>I just wanted to know what most program u do in java? coz i'm a vb
> programmer and i do a lot of database programming.
>
> thanks in advance 






==========================================================================
TOPIC: java.io.FileReader and java.io.FileWriter encoding
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/48b32bb0299455e8
==========================================================================

== 1 of 2 ==
Date:   Fri,   Sep 17 2004 8:10 am
From: Michael Borgwardt <[EMAIL PROTECTED]> 

Mario Maestro wrote:
> When reading a file (written in bytes), Java needs to know which charset 
> to use to convert 8-bit to 16-bit, and I need to know how the default 
> one is picked up.

As an alternative, you can specify the encoding explicitly in InputStreamReader,
which is the preferred way.



== 2 of 2 ==
Date:   Fri,   Sep 17 2004 8:31 am
From: Mario Maestro <[EMAIL PROTECTED]> 

Michael Borgwardt wrote:
> As an alternative, you can specify the encoding explicitly in 
> InputStreamReader,
> which is the preferred way.

I always do it, but the problem is still there with software written by 
others.

Mario




==========================================================================
TOPIC: How can I save the "http response header",like=>Etag: "28094e"
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/7ce0d10cbfea9793
==========================================================================

== 1 of 2 ==
Date:   Fri,   Sep 17 2004 8:36 am
From: [EMAIL PROTECTED] (mike) 

regards:
can I save the "http response header" in the following java codes:
String test="Etag: "28094e"";

or there is another better way to save the http response header,like Etag: "28094e" 

any suggestions is welcome

thank you



== 2 of 2 ==
Date:   Fri,   Sep 17 2004 8:59 am
From: Andrew Thompson <[EMAIL PROTECTED]> 

On 17 Sep 2004 08:36:47 -0700, mike wrote:

> can I save the "http response header" in the following java codes:
> String test="Etag: "28094e"";

No.  That will not compile.  And if you 
had typed that into a Java file and tried 
to compile it, you would already know that.

> or there is another better way to save 
> the http response header,like Etag: "28094e" 

Probably, but since I have little idea
what you are talking about, I am unable 
to advise further.

How are you getting the HTTP response header?
Is it supplied as a String?

> any suggestions is welcome

Show us your (SHORT) example code.
<http://www.physci.org/codes/sscce.jsp>

-- 
Andrew Thompson
http://www.PhySci.org/codes/  Web & IT Help
http://www.PhySci.org/  Open-source software suite
http://www.1point1C.org/  Science & Technology
http://www.lensescapes.com/  Images that escape the mundane




==========================================================================
TOPIC: test if the string is a blank data string
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/681d0b9bedeb1d23
==========================================================================

== 1 of 3 ==
Date:   Fri,   Sep 17 2004 8:36 am
From: Mario Maestro <[EMAIL PROTECTED]> 

karlheinz klingbeil wrote:
> Matt schrub am Donnerstag, 16. September 2004 01:39
> folgendes:
> 
> 
>>If I just want to test if a string is blank data
>>string or not. Do you think this method is good
>>enough?? Or any better approach. Please advise.
>>Thanks.
> 
> 
> public boolean isBlankDataString(String s){
>         return (s==null) ? true : s.trim().equals("");
> }

If you have:

   String s = "   "; // some spaces
   System.out.println(s.equals(s.trim()));

it prints "true", since strings that contain whitespaces only won't be 
modified by trim(). I use the following code:

   public static boolean isNullOrWhitespace(String s) {
     if (s == null) {
       return true;
     }

     for (int i = 0; i < s.length(); i++) {
       if (!Character.isWhitespace(s.charAt(i))) {
         return false;
       }
     }

     return true;
   }

Mario



== 2 of 3 ==
Date:   Fri,   Sep 17 2004 8:55 am
From: Chris Smith <[EMAIL PROTECTED]> 

Mario Maestro wrote:
> If you have:
> 
>    String s = "   "; // some spaces
>    System.out.println(s.equals(s.trim()));
> 
> it prints "true", since strings that contain whitespaces only won't be 
> modified by trim().

Eh?  From the API specification:

    Otherwise, if there is no character with a code greater than
    '\u0020' in the string, then a new String object representing an
    empty string is created and returned.

I haven't tried this.  Does the reference implementation disagree with 
the specification here?

-- 
www.designacourse.com
The Easiest Way to Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation



== 3 of 3 ==
Date:   Fri,   Sep 17 2004 9:05 am
From: Mario Maestro <[EMAIL PROTECTED]> 

> Eh?  From the API specification:
> 
>     Otherwise, if there is no character with a code greater than
>     '\u0020' in the string, then a new String object representing an
>     empty string is created and returned.
> 
> I haven't tried this.  Does the reference implementation disagree with 
> the specification here?
> 

Sorry your're right! I wrote that method once when I had to deal with 
Unicode space characters, that are not trimmed. My example 2-lines code 
should effectively return false, so it depends on what the user needs. 
If only ISO-LATIN-1 white spaces are relevant, then Karlheinz's code is 
perfect. Otherwise, another method is needed.

Mario




==========================================================================
TOPIC: JNI and threads
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/3507a5e81272b473
==========================================================================

== 1 of 1 ==
Date:   Fri,   Sep 17 2004 8:55 am
From: "Aaron Fude" <[EMAIL PROTECTED]> 

Hi,

I will ask a somewhat vague question because I'm working with three
different technologies at once and I first want to get a feel of where the
error is before I give full details.

I have a native methd  myNativeMethod() and the following code:

    myNativeMethod();
    myNativeMethod();
    new Thread() {
      public void run() { myNativeMethod();}
    }.start();

The methods works the first two times (or any N times) but then reliably
fails when called from another thread - an object (global to the native
functions) which used to return non-null now returns null.

So my vague general question is this: from the JNI perspective, what is
different about a method called from the main thread compared to a method
called from a different thread?  (This does not appear to be a
synchronization problem.)

Very many thanks in advance!

Aaron Fude






==========================================================================
TOPIC: html:img with a dynamic value STRUTS
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/8307d0b6770ca5f3
==========================================================================

== 1 of 1 ==
Date:   Fri,   Sep 17 2004 9:06 am
From: Jamie McIlroy <[EMAIL PROTECTED]> 

I have a form bean (searchFormBean) with a String field called 'imageText'.

That string references an image within my app.

When I try <html:img name="searchFormBean" property="imageText">, the 
jsp fails to render.

What am I doing wrong?



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

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/subscribe

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
--------------------------------------------------------------------~-> 

<a href=http://English-12948197573.SpamPoison.com>Fight Spam! Click Here!</a> 
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