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

Today's topics:

* How too.. ?? - 1 messages, 1 author
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/fd299b7c69eb3e1a
* jdbc question - 3 messages, 3 authors
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/bab6d8d5c6089b91
* field name for jOptionPane when using Eclipse? - 3 messages, 3 authors
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/ecc8b53a68d74225
* How to place control in JList? - 2 messages, 2 authors
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/f225c204b8c42c3e
* help on threads/monitor needed - 3 messages, 2 authors
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/cefb56e3aa05046e
* compressing or encrypting a String - 1 messages, 1 author
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/d28e472c042b2e3a
* Doesn't anyone manually compile JSPs? - 1 messages, 1 author
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/4647a3307ad940db
* port 8080 - 3 messages, 3 authors
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/f82ca0681ab641a2
* Hot 22 Year Old Looking For Love Or More.....Please Contact Me.......... 25QY 
- 1 messages, 1 author
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/7fa8991ba4421f88
* How to get list of roles for authenticated user? - 1 messages, 1 author
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/eca88074b3cc9e4
* Symbian or J2ME, which one is the trend? - 2 messages, 2 authors
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/727a56c9759c61bb
* CVS in Eclipse: > (dirty_flag) shown when no differences - 1 messages, 1 
author
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/419ace218b901ddc
* Executing a string related to source code, not the command line - 2 messages, 
1 author
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/a8ce45b68e2f57d1
* JNI and storing C pointers in the Java Class variables - 1 messages, 1 author
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/3948fccf951482eb

==============================================================================
TOPIC: How too.. ??
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/fd299b7c69eb3e1a
==============================================================================

== 1 of 1 ==
Date: Thurs, Dec 30 2004 5:28 pm
From: anonymous  

H. Sommers wrote:
> The picture will not appear, but why??????????
> When I use a simple applet, it works.
> 
> -------------------------------------------------------------------------------------------------------------------------
> package test;
> 
> public class TestClass
> {
> 
>   public TestClass()
>   {
>   }
> 
>   public static void main(String[] args)
>   {
>     TestClass testClass = new TestClass();
>     TestFrame test = new TestFrame();
>     test.show();
>   }
> 
> }
> -----------------------------------------------------------------------------------------------------------------------------
> 
> package test;
> 
> import java.awt.*;
> import javax.swing.*;
> 
> public class TestFrame extends JFrame
> {
>   JButton jButton1 = new JButton();
> 
>   public TestFrame()
>   {
>     try
>     {
>       jbInit();
>     }
>     catch(Exception e)
>     {
>       e.printStackTrace();
>     }
>   }
> 
>   private void jbInit() throws Exception
>   {
>     jButton1.setText("jButton1");
>     jButton1.setBounds(new Rectangle(67, 37, 182, 114));
>     this.getContentPane().setLayout(null);
>     this.setSize(new Dimension(300, 300));
>     this.getContentPane().add(jButton1, null);
>   }
> 
>   // ????????????????????????????
>   // ????????????????????????????
>   // ????????????????????????????
>   private void picture()
>   {
>     ImageIcon pic = new ImageIcon("images/duke.gif");
>     jButton1.setIcon(pic);
>   }
> 
> }
> 
> 
> 
Have you tried calling picture()? Like this:
  private void jbInit() throws Exception
    {
      jButton1.setText("jButton1");
      jButton1.setBounds(new Rectangle(67, 37, 182, 114));
      this.getContentPane().setLayout(null);
      this.setSize(new Dimension(300, 300));
      this.getContentPane().add(jButton1, null);
     picture();
    }




==============================================================================
TOPIC: jdbc question
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/bab6d8d5c6089b91
==============================================================================

== 1 of 3 ==
Date: Thurs, Dec 30 2004 11:45 am
From: Sudsy  

Thomas Kellerer wrote:
<snip>
> Without specific requirements there is no way telling which version is 
> better. If this is e.g. a data load that is performed during the night, 
> the the solution is absolutely valid. If this is a use case with highly 
> partioned data (each user edits different records) then it's valid as 
> well, if the situation is a highly dynamic entry system where the 
> situation that you sketched is very likely to happen, then obviously 
> this is not a good idea. On the other hand: if you expect more updates 
> then inserts to be successful, the overall performance would be *much* 
> better this way because the index lookup for the primary key is only 
> needed once for the update but twice for the inser/update combo.
> 
> I was simply offering a different solution. If it's feasible for the 
> situation of the OP is up to him (and he did not give information to us 
> in order to judge that)

Thomas,
    You raise an excellent point. You can't optimize your approach unless
you know how the database is going to be used. In some situations you're
going to have a lot of inserts (e-commerce, for example) while in others
you're only performing updates (e.g. banking).
    Goodness knows, if you're doing a batch load on some databases then
you're better off dropping the indices, performing the load, then
recreating the indices. It takes less time than updating the indices
when loading records individually.
    Which only goes to show that JDBC programmers should be familiar
with underlying database concepts. Thanks for sharing your ideas!



== 2 of 3 ==
Date: Thurs, Dec 30 2004 5:12 pm
From: Mark Thornton  

Virgil Green wrote:
> Mark Thornton wrote:
> 
>>Chris Uppal wrote:
>>
>>>Mark Thornton wrote:
>>>
>>>
>>>
>>>>By contrast the query to find if the row
>>>>exists can be written to work unchanged on most databases, although
>>>>as you point out it is likely to be slower.
>>>
>>>
>>>Or, more accuately, /not/ work on most databases ;-)  It leaves a
>>>hole where another app could insert the to-be-duplicate row into the
>>>DB between your query and your insert.
>>
>>Not true --- it will work wherever transactions are properly
>>supported. You simply have to turn off the auto commit and commit the
>>transaction yourself after doing the update(s). Admittedly you may
>>still have to watch for serialization exceptions (deadlock), but that
>>should be rare.
> 
> 
> I'm not familiar with any database that can maintain the integrity of a
> transaction by guaranteeing that a record continues to *not* exist
> throughout the transaction. Prevent deletion and updates to an existing
> record outside the transaction? Yes. Ensure that a record that didn't exist
> at the beginning of the tranaction is only created within the transaction?
> Not to my knowledge. Which ones do this?
> 

SQL Server for one, but not in its default state. It depends on the 
transaction isolation level (which you can specify via JDBC). Only the 
highest level of isolation has the correct property.

Mark Thornton

 From SQLServer "books online":

SERIALIZABLE

Places a range lock on the data set, preventing other users from 
updating or inserting rows into the data set until the transaction is 
complete. This is the most restrictive of the four isolation levels. 
Because concurrency is lower, use this option only when necessary. This 
option has the same effect as setting HOLDLOCK on all tables in all 
SELECT statements in a transaction.




== 3 of 3 ==
Date: Thurs, Dec 30 2004 5:36 pm
From: Dimitri Maziuk  

Chris Uppal sez:
...
> Before this thread, I hadn't realised just how badly broken the JDBC stuff
> is -- insert-and-catch-error is a natural technique, but it seems to be more
> than a little tricky to code it up in JDBC.

Here's another one:
try { statement.executeUpdate( "DROP TABLR FOO" ); }
catch( SQLException e ) { /* ignore -- table may not exist yet */ }

Most of it is SQL suckage, though. JDBC at least looks like it was
written by people who actually know how to write code (unlike some
other APIs in Java). Those few bits of SQL I've seen (I'm not paying
for the privilege to see the standard, but that's another rant) look
like they were written by software engineering PhDs from IT Dept. of
a Prestigious Non-accredited School of Business and Accounting.

Dima
-- 
The most horrifying thing about Unix is that, no matter how many times you hit
yourself over the head with it, you never quite manage to lose consciousness.
It just goes on and on.                                  -- Patrick Sobalvarro




==============================================================================
TOPIC: field name for jOptionPane when using Eclipse?
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/ecc8b53a68d74225
==============================================================================

== 1 of 3 ==
Date: Thurs, Dec 30 2004 11:29 am
From: Sudsy  

Chris Smith wrote:
<snip>
> Speaking of coding stuff by hand, it's worth mentioning that a fair 
> number of people (myself included, actually) hold the belief that it's 
> actually easier to build Java GUIs by hand rather than use a visual GUI 
> designer.  The reason is that layout managers actually give you a much 
> higher-level view of the GUI layout.  So while a GUI builder is 
> necessary, for example, in Visual Basic to prevent specifying pixel 
> coordinates for everything, they can just get in the way in Java.
> 
> Before that's true, though, you'd need to learn how all the major layout 
> managers actually work.  I don't know, at this point, if your problems 
> are with Ecplise VE, or with the layout managers you're trying to use.  
<snip>

I'm in complete agreement with Chris on this one. I often sketch the
layout on a piece of paper (!) first so that I can immediately see
how the pieces fit together. Then it's just a matter of coding. You
can also see whether FlowLayout will do or if you require CardLayout
or something even more sophisticated. It makes actual development go
quite quickly...
YMMV



== 2 of 3 ==
Date: Thurs, Dec 30 2004 5:11 pm
From: ted holden  


At this point I can't tell whether the problems with the layout managers or
with the way Eclipse and its visual editor try to use them.  Nonetheless
the problems are real and the idea of trying to write java guis by hand is
a non-starter for a number of reasons.  Aside from that, as I noted, the
swing components work fairly nicely and eliminate the problem, at least for
the time being.



== 3 of 3 ==
Date: Thurs, Dec 30 2004 8:58 pm
From: ByteCoder  

ted holden wrote:
> At this point I can't tell whether the problems with the layout managers or
> with the way Eclipse and its visual editor try to use them.  Nonetheless
> the problems are real and the idea of trying to write java guis by hand is
> a non-starter for a number of reasons.  Aside from that, as I noted, the
> swing components work fairly nicely and eliminate the problem, at least for
> the time being.

I use netBeans as a GUI editor. Works very fine. :)

-- 
-------------
- ByteCoder -           ...I see stupid people
-------------
                    Curiosity *Skilled* the cat




==============================================================================
TOPIC: How to place control in JList?
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/f225c204b8c42c3e
==============================================================================

== 1 of 2 ==
Date: Thurs, Dec 30 2004 8:53 am
From: [EMAIL PROTECTED] 

I need ability to put JPanel component in line of JList. I have wrote
CustomListCellRenderer class. It works. In list displays me panel with
some components. But I can't do anything with them!!! For JTable I can
create my own CellEditor, which resolve problems with editing. What can
I do with JList?

P.S. Of course, I can use JTable instead JList, but it isn't
preferable.

Thanks.




== 2 of 2 ==
Date: Thurs, Dec 30 2004 6:02 pm
From: ByteCoder  

[EMAIL PROTECTED] wrote:
> I need ability to put JPanel component in line of JList. I have wrote
> CustomListCellRenderer class. It works. In list displays me panel with
> some components. But I can't do anything with them!!! For JTable I can
> create my own CellEditor, which resolve problems with editing. What can
> I do with JList?
> 
> P.S. Of course, I can use JTable instead JList, but it isn't
> preferable.
> 
> Thanks.
> 

You should add eventlisteners.

-- 
-------------
- ByteCoder -           ...I see stupid people
-------------
                    Curiosity *Skilled* the cat




==============================================================================
TOPIC: help on threads/monitor needed
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/cefb56e3aa05046e
==============================================================================

== 1 of 3 ==
Date: Thurs, Dec 30 2004 5:59 pm
From: ByteCoder  

[EMAIL PROTECTED] wrote:
> Thanks again ByteCoder!
> The reason for using different classes (which are 'Runnable') is to
> handle different Strings comming/going to RS232, as I told before. The
> structure of the Strings are quite different, which makes it too
> difficult to handle in one serialEvent method.
> Could somebody answer to my questions, which I guess are elemantary to
> all thread freaks out there:
> Once again:
> Can I use synchronized (applied to methods) applied in several classes,
> using one lock (my boolean parameter which I set true and false in the
> synchronized methods)? My access to the lock would go through the
> argument passed in the constuctor, to make my lock parameter 'visible'.
> 
> snippet:
> public class T1 implements ... {
> ...
> private SerialConnection connection;
> 
> //constructor
> public T1(SerialConnection connection){
> this.connection = connection;
> }
> 
> 
> public synchronized void serialEvent(SerialPortEvent e) {
> ...
> 
> connection.threadActive = false; // is this possible?
> }
> }//class
> 
> In the calss SerialConnection I have declared the attribute
> public volatile boolean threadActive;  // I use this as lock
> which is set true in another synchronized method before entering the
> serialEvent method above
> 
> Frank
> 

 From your above statements I get the idea you don't really know what 
the synchronized keyword does.

The synchronized keyword is used to prevent any other thread calling the 
synchronized methods/blocks (that's *all* the synchronized methods in a 
class) when one thread is using them. If that one thread is done (the 
method completed) the other threads can use the method again on a first 
come, first serve basis (they don't 'wait in line'). The thread that's 
waiting who 'gets there first' can execute the method.
This all happens automatically. You only have to specify the 
synchronized keyword before a (or more) method(s).

Example:

public synchronized void displayString(String message) {
     //...
}

If another thread would call this method, but you already are setting 
the text using this method the other thread will wait until you are done 
setting the text.

-- 
-------------
- ByteCoder -           ...I see stupid people
-------------
                    Curiosity *Skilled* the cat



== 2 of 3 ==
Date: Thurs, Dec 30 2004 9:40 am
From: [EMAIL PROTECTED] 

This cannot be the whole story, because without the wait() inside the
synchronized method I get the WaitCommEvent: Error 6 and with the
wait() built into the while block
while(lock-variable){
try{
wait();
}catch(InterruptedException ex){}
}
the program freezes after the first thread finished execution.
All other threads also listen to this lock-variable. If I do some
System.out.println on the current thread I see my lock-variable turn
false after the first thread finished but this has no effect to the
other threads waiting
involved are
AWT-EventQueue-0
Win32SerialPort Notification thread
and it looks like the lock cannot be carried from 2nd to 1st

Frank




== 3 of 3 ==
Date: Thurs, Dec 30 2004 9:02 pm
From: ByteCoder  

[EMAIL PROTECTED] wrote:
> This cannot be the whole story, because without the wait() inside the
> synchronized method I get the WaitCommEvent: Error 6 and with the
> wait() built into the while block
> while(lock-variable){
> try{
> wait();
> }catch(InterruptedException ex){}
> }

Now I see (maybe). You should first assign false to the lock-variable 
and then you *MUST* interrupt/notify the thread.

> the program freezes after the first thread finished execution.
> All other threads also listen to this lock-variable. If I do some
> System.out.println on the current thread I see my lock-variable turn
> false after the first thread finished but this has no effect to the
> other threads waiting
> involved are
> AWT-EventQueue-0
> Win32SerialPort Notification thread
> and it looks like the lock cannot be carried from 2nd to 1st

No offense, but please give me *one* good reason why you want to manage 
your threads, while java can do it better.

-- 
-------------
- ByteCoder -           ...I see stupid people
-------------
                    Curiosity *Skilled* the cat




==============================================================================
TOPIC: compressing or encrypting a String
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/d28e472c042b2e3a
==============================================================================

== 1 of 1 ==
Date: Thurs, Dec 30 2004 6:06 pm
From: "Filip Larsen"  

James Kanze wrote

> CRC codes are another good source -- done correctly, they can be
> a lot faster than MD5.  (I've never implemented SHA-1.)

I haven't measured their performance, but the build-in
java.util.zip.CRC32 and Adler32 have served me well in the past.


Regards,
-- 
Filip Larsen






==============================================================================
TOPIC: Doesn't anyone manually compile JSPs?
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/4647a3307ad940db
==============================================================================

== 1 of 1 ==
Date: Thurs, Dec 30 2004 12:56 pm
From: Chris Riesbeck  

In article <[EMAIL PROTECTED]>,
 [EMAIL PROTECTED] wrote:

> Tomcat uses the /tomcat/bin/jspc.bat file to make java servlets out of
> the JSPs.  Run this program without parameters to view the help screen.
> It's pretty simple and easy to use.  ...
> 
> Duane Morse wrote:
> > With the exception of JRun, I've not seen any references to manually
> > compiling JSPs; everyone expects you
> > to let the servlet container do the compiling. ...
> >
> > Does anyone developing JSPs compile them outside of the servlet
> container?
> > Do your JSPs use tag libraries?
> > If so, what tools are you using?  TIA.

The Tomcat doc's include an ANT task for translating
JSP to servlet and compiling the results. Worked for
me in Gel with JSTL pages, though some errors don't
crop up till run-time, especially in EL forms.

http://jakarta.apache.org/tomcat/tomcat-5.5-doc/jasper-howto.html




==============================================================================
TOPIC: port 8080
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/f82ca0681ab641a2
==============================================================================

== 1 of 3 ==
Date: Thurs, Dec 30 2004 11:06 am
From: "Anubhav"  

Dear all,port 8080 is closed on my system.i need it to run tomcat5.0
how can i enable this port




== 2 of 3 ==
Date: Thurs, Dec 30 2004 1:09 pm
From: "Ryan Stewart"  

"Anubhav" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> Dear all,port 8080 is closed on my system.i need it to run tomcat5.0
> how can i enable this port
>
Open it.

Seriously, what are you talking about? 





== 3 of 3 ==
Date: Thurs, Dec 30 2004 11:14 am
From: "Techie"  

You mean on your local (PC) development machine?  If you're getting
some type of 'Bind' error then Tomcat is probably already running.
Smartline has a program called 'Active Ports' that could help.
Active Ports Developer:  http://www.protect-me.com/freeware.html





==============================================================================
TOPIC: Hot 22 Year Old Looking For Love Or More.....Please Contact Me.......... 
25QY
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/7fa8991ba4421f88
==============================================================================

== 1 of 1 ==
Date: Thurs, Dec 30 2004 1:10 pm
From: "Ryan Stewart"  

"Sudsy" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> [EMAIL PROTECTED] wrote:
>> Hi
>>  Im 22 and I really need someone to take care of me.
> <snip>
>
> Anyone else get a kick out of the (claimed) originating domain?
> Free Venereal Disease?! Thanks, but I'll pass...  ;-)
lol

Never even saw the original. My news server must have filtered it. 






==============================================================================
TOPIC: How to get list of roles for authenticated user?
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/eca88074b3cc9e4
==============================================================================

== 1 of 1 ==
Date: Thurs, Dec 30 2004 11:21 am
From: "Techie"  

I know about those, but what I want to be able to do is get a list of
all the roles for a given authenticated user.  Doesn't seem like that
is possible from the servlet API's.  Kinda want to know how people are
working around it, and maybe why it wasn't in the API.  I mean, if you
can ask a user if he belongs to a role, why not be able to get a list
of those roles instead of asking isUserInRole(x), isUserInRole(y),
isUserInRole(37), isUserInRole(38), etc.?

May just be the funkiness of my authentication/authorization scheme.
We're using Tomcat, but have two separate web apps, and not enough dev
db connections to get from one of the web apps to one of the db
schemas.  So, we were hoping the HttpServletRequest could provide us
with a list of the roles for a particular user.

Also, trying to figure out how web.xml roles tie into roles defined
through the Realm stuff with Tomcat, which we're using.  Any
easy-to-understand docs?





==============================================================================
TOPIC: Symbian or J2ME, which one is the trend?
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/727a56c9759c61bb
==============================================================================

== 1 of 2 ==
Date: Thurs, Dec 30 2004 9:34 pm
From: Maxim Kasimov  

Andrew McDonagh wrote:
> Maxim Kasimov wrote:
> 
>> [EMAIL PROTECTED] wrote:
>>
>>> hi,
>>>
>>> For mobile software development, J2ME is more portable and widely
>>> supported; Symbian, with the largest mobile OS market share, is more
>>> feature-rich and powerful. They each has pro's and con's.
>>>
>>> I wander nowadays which one is the trend...are more and more people
>>> moving to J2ME platform for development of mobile software, or there
>>> are still a lot of people firmly sticking to Symbian native
>>> development.
>>>
>>> Thanks very much.
>>>
>>
>> IMHO it does not matter which platform have more features than another.
>> Matters only the content you can make - if for game or application 
>> implementing
>> quite enough features of midp1.0 you should not use Symbian native 
>> development.
>>
> 
> Mobile operators favour Java over symbian - so much so that our symbian 
> apps development has stopped and has been ported to Java.
> 
> Its because there's actually far more Java enabled phones than Symbian.

IMHO at other side (as i've said before: matters only the content)
you can make some Symbian application for only one model and it will be more
popular than any other of your java-game you have ever made for a lot models

-- 
Best regards,
Maxim



== 2 of 2 ==
Date: Thurs, Dec 30 2004 12:12 pm
From: "[EMAIL PROTECTED]"  

Several people already pointed out that there are much
more mobile devices supporting J2ME than Symbian (most
device using Symbian provide J2ME support :)

Another concern for software development companies is
that J2ME, while more limited, is inherently more secure
than Symbian.

I did some contracting work for a company using
mobile J2ME devices as thin client. The "restriction" of
J2ME (mainly the inability to access to all the gizmos
of the various devices) were no concern. Things that
mattered were:
- development time (way faster using J2ME)
- security (way more secure using J2ME)
- network access (more limited using J2ME (?) but
sufficient to get the work done).

So it all depends on the application you plan to write.

Sun made an incredible work regarding the security
of the Java virtual machine (ever heard of a Java
buffer overflow/overrun? in how many years?) and
they seem to have done it once again in the "mobile"
arena.

At a time when we're beginning to see the first
viruses/malware/whatever targetting mobile devices,
Sun seems to be amongst the few ones that "got it".

Once more.

Jean





==============================================================================
TOPIC: CVS in Eclipse: > (dirty_flag) shown when no differences
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/419ace218b901ddc
==============================================================================

== 1 of 1 ==
Date: Thurs, Dec 30 2004 11:44 am
From: [EMAIL PROTECTED] 

Hi all,

I am running Eclipse on XP, connected to CVS repository on Linux.
Sometimes I get the > (dirty_flag) symbol shown next to
some packages, but after synchronizing, it shows that resources
are in synch (which they are). Any idea what's going on?





==============================================================================
TOPIC: Executing a string related to source code, not the command line
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/a8ce45b68e2f57d1
==============================================================================

== 1 of 2 ==
Date: Thurs, Dec 30 2004 11:59 am
From: "Arun"  

How can i execute a string, for example:

int x = 2;
int y = 4;
int z;
String command = " z = x*y "


For some background on why i want to do this:


I have an element tree.
To add a certain element, i need to use the following command:
element.getChild("bla").setContent(newElement);

Problem is that the number of .getChild() corresponds to the element
depth in the tree.
So if its depth was two, then the command would be:
element.getChild("bla's dad").getChild("bla").setContent(newElement);

I can't do a for loop and then with every iteration get the child from
the previous child, because when i add an element i won't be adding it
to the whole element tree, il just be adding it to the previous
element.

I could build the whole tree again but that seems wasteful.




== 2 of 2 ==
Date: Thurs, Dec 30 2004 12:08 pm
From: "Arun"  

Let me rephrase the third paragraph:

I cant do a for loop because when i add an element, i will only be
adding it to its parent (which now will exist as its own element).
Instead i want to add the element to the whole tree.





==============================================================================
TOPIC: JNI and storing C pointers in the Java Class variables
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/3948fccf951482eb
==============================================================================

== 1 of 1 ==
Date: Thurs, Dec 30 2004 12:10 pm
From: "Ann"  


"Gordon Beaton" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On 29 Dec 2004 00:46:18 -0800, [EMAIL PROTECTED] wrote:
> > Long does not work, but I need to double-check my code.
>
> It always has for me.
>
> > One question :
> > will pointer-as-long be also OK on a 64bits machines ?
> > ( I do not have an Itanium, but AMD does have fine 64bits CPU... )

Use a double.

>
> I can't see why not. Java long is 64 bit signed, but since you
> shouldn't be manipulating the value in Java anyway, the sign shouldn't
> make any difference for storing 64 bit pointer values.
>
> /gordon
>
> --
> [  do not email me copies of your followups  ]
> g o r d o n + n e w s @  b a l d e r 1 3 . s e





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

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

To post to this group, send email to [EMAIL PROTECTED] or
visit http://groups-beta.google.com/group/comp.lang.java.programmer

To unsubscribe from this group, send email to
[EMAIL PROTECTED]

To change the way you get mail from this group, visit:
http://groups-beta.google.com/group/comp.lang.java.programmer/subscribe

To report abuse, send email explaining the problem to [EMAIL PROTECTED]

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

Reply via email to