 |
 |
Index ‹ java-programmer
|
- Previous
- 2
- i18n currencyhi all,
i need to internationalize the currency symbol in my application.
please advice on how that can be done
thanks
Chanchal
- 2
- java.netHello
How can I get the ip and mac address of the networking device
(eth0)?? is it possible with the InetAddress??
I want to get the ip address given by the ISP.
Sincerly
DigitaluX
- 3
- Analytical or IntuitiveI have a test online that measures cognitive style. It determines
whether the participant has an intuitive or analytical learning style.
It takes about 5 minutes.
It's here: http://www.elena.com
I'm a long-time software engineer who's thinking about changing
careers, hence the psychology course. I ended up wanting to study
people like me (not surprising I guess).
I know the sample will be non-probabilistic. So this will be a
quasi-experiment.
Elena
- 3
- JDK 1.1.8 V1999-11-9 on recent FBSD 4Hi all,
I tried to run JDK 1.1.8 V1999-11-9 (ELF version) on my FreeBSD
4.8-STABLE box. It could not run and I had the following message:
% java Linpack
/usr/libexec/ld-elf.so.1: /usr/lib/libm.so.2: Undefined symbol "__stderrp"
% java -version
/usr/libexec/ld-elf.so.1: /usr/lib/libm.so.2: Undefined symbol "__stderrp"
% java
/usr/libexec/ld-elf.so.1: /usr/lib/libm.so.2: Undefined symbol "__stderrp"
% jar
/usr/libexec/ld-elf.so.1: /usr/lib/libm.so.2: Undefined symbol "__stderrp"
% java_g
/usr/libexec/ld-elf.so.1: /usr/lib/libm.so.2: Undefined symbol "__stderrp"
Can the JDK 1.1.8 work on recent FBSD 4 and 5?
How can I avoid this problem?
Kazuyuki Shudo email***@***.com http://www.shudo.net/
_______________________________________________
email***@***.com mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-java
To unsubscribe, send any mail to "email***@***.com"
- 5
- JDBCAdapter & close() method ?Do you know JDBCAdapter from j2sdk TableExample:
JDBCAdapter extends AbstractTableModel {
....
public void close() throws SQLException {
System.out.println("Closing db connection");
resultSet.close();
statement.close();
connection.close();
}
...
}
Who start the close() method on exit of my application???
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.725 / Virus Database: 480 - Release Date: 19.7.2004
- 5
- Detecting KeyBoard events on a JDialogHello,
i have a JDialog subclass, with a lot of components in it, and i would
like to detect Ctrl+C on it. I've tried to use this:
protected void register(JComponent jcomp) {
Action action = new AbstractAction("Action") {
public void actionPerformed(ActionEvent evt) {
System.err.println("Action!!!");
}
};
KeyStroke key = KeyStroke.getKeyStroke(KeyEvent.VK_C,
KeyEvent.CTRL_DOWN_MASK);
jcomp.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(key, "myaction");
jcomp.getInputMap(JComponent.WHEN_FOCUSED).put(key, "myaction");
jcomp.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(key,
"myaction");
jcomp.getActionMap().put("myaction", action);
}
wich is call like that:
register((JComponent)getContentPane());
register((JComponent)getGlassPane());
register(getRootPane());
but my action is never performed.
So i've registered a KeyListener recursively on my dialog, and the
keylistener is called with getSource() returning the dialog ref. But the
dialog has no inputMap so how can i do?
I can't use the recursive trick because there are 2 JTables in the
Dialog which must keep its default copy behavior, and a lot of text
fields too.
Thanks for any help.
- 6
- Thread for ProgressBarHi all,
I have a question on threading for the progressbar.
My program will call a few methods and those methods are really time
consuming, the time it takes all depends on how much information are
being pump in, sometimes it can be less than half a minute, sometimes
it can go up to few minutes. So determining the percentage of the
progressbar is impossible.
So how do I find out the total length of the process so that I can
update the progressbar's percentage accordingly?
- 7
- jbutton/jlabel disspearing textHi,
I have created a few JButtons/JLabels but the text on them seems to
disappear depending on the platform the gui is run on (The disappearing text
appears as "..."). How is it possible to set the size of the label/button
according to the length of the text?
Thanks,
Adrien
- 9
- how to read multiple (binary) lines from text file / stdin?
hi group!
i am writing a small tool to dump data from oracle databases and i want
to implement the possibility to execute sql statements read from stdin
or from a file. i have so far managed to do so, but every sql statement
must be on a single line with no ";" at the end of each line.
i would like to use an input file like this:
-- file statement.sql --
select * from table
where thing = "something";
------------------------
or
-- file statement.sql --
update table
set image = '<binary data>'
where thing = otherthing;
------------------------
this is how the code looks so far:
// code start
BufferedReader in = new BufferedReader(new FileReader(filename));
while (((statement=in.readLine())!= null) &&(!statement.equals(""))){
try {
ResultSet rset = stmt.executeQuery(statement);
[...]
}
}
// code end
i would like 'statement' to contain the multiline sql statement
including all newlines so that also binary data may be inserted into the
db so i tried to use
System.setProperty("line.separator", ";");
but that didn't help and also doesn't seem the right way for what i want
to achieve. could someone please point me into the right direction on
how to do that? the variety of different stream classes is somewhat
confusing in terms of finding the right class for the right job.
big TIA, armin
--
armin walland
focusmr.com
maculangasse 8
1220 wien
- 9
- [JavaIDL] Releasing CORBA object references in Java ?<previously posted on comp.object.corba, with no response yet>
Hi all,
I really wonder what's the use of org.omg.CORBA.Object._release() and
_duplicate().
I was thinking that reference counting was the job of GC.
In C++ the reference counting, via the usage or _var and _ptr and methods
release() and duplicate(), is without ambiguity (even if complex and error
prone). But here in Java, the introduction of _release() and _duplicate() is
very strange.
Another point for the discussion: as I am using the JDK ORB implementation,
the Java Doc says:
"
- Object _duplicate()
Returns a duplicate of this CORBA object reference. The server object
implementation is not involved in creating the duplicate, and the
implementation cannot distinguish whether the original object reference or a
duplicate was used to make a request.
Note that this method is not very useful in the Java platform, since
memory management is handled by the VM. It is included for compliance with
the CORBA APIs.
The method _duplicate may return this object reference itself.
- void _release()
Signals that the caller is done using this object reference, so internal
ORB resources associated with this object reference can be released. Note
that the object implementation is not involved in this operation, and other
references to the same object are not affected.
"
My opinion here is that releasing references or not won't make any
difference, and duplicating them is pointless.
But what does the standard says ?
Thanks in advance,
JC.
- 10
- Custom eventHello All,
How can I write a custom event?
I want to create a custom event object and fire it at a particular point in
program.
Thanks in advance!
Regards
Suma
- 10
- Uptodate MSN messenger API?Guys,
Does anyone know of an up to date MSN Messenger API in Java? I've found
similar for Yahoo and Skype, but I'd like to be able to use MSN (mainly
because our company is moving off Yahoo to MSN over the coming year).
I've searched SourceForge but everything there seems to have been
stopped at least a year ago.
Any suggestions appreciated.
Cheers,
Chris
- 14
- bsd implementation ofOn Thu, Jan 17, 2008 at 08:13:00PM -0800, Michael Allman wrote:
> There's a bug in the bsd patch to FileChannelImpl.c, as described in the
> subject of this message. FYI, I have verified this using the "current"
> jdk16 freebsd patchset found here:
>
> http://www.eyesbeyond.com/freebsddom/java/JDK16JRLConfirm.html
D'oh...there certainly is.
> I haven't fully analyzed the impact of this defect. I can say that in my
> case, if I call FileChannel.transferTo(0, 100, socketChannel), where 100
> is less than the length of the file in question, it transfers the entire
> file to the destination. According to the docs for this method, it should
> only transfer a maximum of 100 bytes. This is key to my particular usage
> of this method.
The problem is that it ignores the count entirely and just transfers the
whole thing.
> I can attempt to provide a patch, but C is not my thing, and I could not
> make a reliable claim as to the correctness of my patch. Also, there's
> the whole license issue. Fixing this seems simple enough, though. I
> would like to help insofar as I can.
Something like this maybe? (Untested)
--- ../../j2se/src/solaris/native/sun/nio/ch/FileChannelImpl.c 6 Mar 2007 17:45:05 -0000 1.11
+++ ../../j2se/src/solaris/native/sun/nio/ch/FileChannelImpl.c 18 Jan 2008 08:11:36 -0000
@@ -264,11 +264,12 @@
return IOS_THROWN;
}
- while ((r = pread(srcFD, buf, 4096, offset)) > 0) {
+ while (count > 0 && (r = pread(srcFD, buf, (count < 4096) ? count : 4096, offset)) > 0) {
w = write(dstFD, buf, r);
if (w == -1)
break;
offset += w;
+ count -= w;
}
free(buf);
> Also, I know this is getting pushy, but it seems like fixing this issue
> would be a great time to replace the current implementation of this method
> with a true bsd sendfile() call. I could give that a try, too.
As noted in the comments, you can't since the BSD implementation of
sendfile(2) expects to be sending the file to a socket, not just any old
file descriptor. Solaris and Linux are both ok with any old fd.
--
Greg Lewis Email : email***@***.com
Eyes Beyond Web : http://www.eyesbeyond.com
Information Technology FreeBSD : email***@***.com
_______________________________________________
email***@***.com mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-java
To unsubscribe, send any mail to "email***@***.com"
- 15
- Servlet LDAP Web Server AuthenticationThis may not be the correct place to post this; however, please bear
with me.
Platform: Solaris 9
iPlanet Web Server
Java Servlets/JSP website
I have a servlet that displays the contents of a directory as links
available for downloading/viewing. I have also locked this directory
down using LDAP through the web administration page of iPlanet. What
I would like to happen is to authenticate to the web server first,
before the links are displayed, so that when the user clicks on the
links, they are not prompted with the typical gray box asking for a
username and password. I've researched and implemented JNDI,
authenticated to LDAP, tailed the logs, and I authenticate fine. My
servlet loads, and the first thing it does is query ldap and
authenticate. Next it prints out the page containing the links.
(I've even tried not closing the context) But as soon as I click on
the links, I am prompted again. I am assuming (and very fuzzy on how
this works) that yes, I authenticated to LDAP. But the webserver
doesn't know that. So how do I get the webserver to realize that I've
already authenticated? Any help would be appreciated.
Thanks,
Kim
- 15
- help with saving a JPanel to jpgI have a JPanel that I paint with a graph. The upper 40% is a graph
with a grid background, and the rest is a legend for the graph. When I
try to save the JPanel as a jpg, I get an image with the same
dimensions but there is no graph or legend and the grid, which uses the
dimensions to set the upper grid limit, covers the entire panel.
Everything on screen is fine. The current code is below. I've tried
the available varieties of paint and tried using the Robot class
(though this could be explored more). Any tips on where I'm messing up
or what could be changed to get this working would be appreciated.
java.awt.image.BufferedImage image = new java.awt.image.BufferedImage(
panel.getPreferredSize().width,
panel.getPreferredSize().height,
java.awt.image.BufferedImage.TYPE_INT_RGB);
java.awt.Graphics2D g = image.createGraphics();
g.setRenderingHint(java.awt.RenderingHints.KEY_FRACTIONALMETRICS,
java.awt.RenderingHints.VALUE_FRACTIONALMETRICS_ON);
g.setRenderingHint(java.awt.RenderingHints.KEY_TEXT_ANTIALIASING,
java.awt.RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
panel.paintAll(g);
g.dispose();
javax.imageio.ImageIO.write(image, "jpeg",
new java.io.File("./" + jtf.getText() + ".jpg"));
image.flush();
|
| Author |
Message |
kotkot

|
Posted: 2003-11-12 1:51:00 |
Top |
java-programmer, JAVA scipt needed
Hi all - I am looking for a JAVA script that automatically downloads
and executes a .exe or .com program upon clicking a link.
Let me know (I'd appreciate an answer to my email address as well)
Thanks ...
|
| |
|
| |
 |
Joona I Palaste

|
Posted: 2003-11-12 2:59:00 |
Top |
java-programmer >> JAVA scipt needed
email***@***.com scribbled the following:
> Hi all - I am looking for a JAVA script that automatically downloads
> and executes a .exe or .com program upon clicking a link.
> Let me know (I'd appreciate an answer to my email address as well)
comp.lang.javascript is that way ====================================>
--
/-- Joona Palaste (email***@***.com) ------------- Finland --------\
\-- http://www.helsinki.fi/~palaste --------------------- rules! --------/
"I said 'play as you've never played before', not 'play as IF you've never
played before'!"
- Andy Capp
|
| |
|
| |
 |
VisionSet

|
Posted: 2003-11-12 9:13:00 |
Top |
java-programmer >> JAVA scipt needed
<email***@***.com> wrote in message
news:email***@***.com...
> Hi all - I am looking for a JAVA script
No...
You are looking for a JavaScript
in which case, wrong group.
We don't do scripting here. Unless you're wanting JSTL?
Incidentally, if you look here:
http://www.w3schools.com/js/default.asp
You will see a coffee cup next to their JavaScript blurb.
What's that all about?
Have the JS brigade nicked our device as well as our name?
--
Mike W
|
| |
|
| |
 |
Anton Spaans

|
Posted: 2003-11-12 22:58:00 |
Top |
java-programmer >> JAVA scipt needed
Hi,
I think that is virtually impossible.
1. JavaScript is not allowed to open sockets (internet connections to the
outside - or even inside - world). The only way to do that is to use FRAMEs
or IFRAMEs inside your main HTML.
2. For security reasons, Java script can not execute external (and
downloaded) programs.
3. Then you're left with writing a plug-in/ActiveX control to do what you
want, where your Java script instructs that plug-in/ActiveX control what to
do.
-- Anton.
(BTW: be very cautious about posting your e-mail address in newsgroups. You
may get slammed with spam later :-) )
<email***@***.com> wrote in message
news:email***@***.com...
> Hi all - I am looking for a JAVA script that automatically downloads
> and executes a .exe or .com program upon clicking a link.
>
> Let me know (I'd appreciate an answer to my email address as well)
>
> Thanks ...
|
| |
|
| |
 |
Jezuch

|
Posted: 2003-11-13 1:51:00 |
Top |
java-programmer >> JAVA scipt needed
U縴tkownik email***@***.com napisa?
> Hi all - I am looking for a JAVA script that automatically downloads
> and executes a .exe or .com program upon clicking a link.
Hey, you don't need scripts to do that, just use Internet Explorer :]
--
Ecce Jezuch
"Arise as did the gods Ninti
and Ishkur, Ishkur!" - S. Tankian
|
| |
|
| |
 |
| |
 |
Index ‹ java-programmer |
- Next
- 1
- Problem reading from nio socketchannels into a bytebufferAt:
http://www.javanio.info/filearea/bookexamples/unpacked/com/ronsoft/books/nio/channels/SelectSockets.java
There is sample code. In that page there are the lines:
// send the data, don't assume it goes all at once
while (buffer.hasRemaining()) {
socketChannel.write (buffer);
}
// WARNING: the above loop is evil. Because
// it's writing back to the same non-blocking
// channel it read the data from, this code can
// potentially spin in a busy loop. In real life
// you'd do something more useful than this.
In some of my code I have written a line more or less exactly like:
while (buffer.hasRemaining()) {
socketChannel.write (buffer);
}
and the code does just spin. What is an example of "something more
useful than this"?
Jeff
- 2
- How to use regex to split a sentence with different spaces?Hi,
I saw the following code to split a sentence into words. My question is:
How could I modify the code to split a sentence like(in his example,
the words are separated by EXACTLY ONE SPACE by chance):
"But I'm not dead yet! I feel happy!"
<Code>
// : c12:ReplacingStringTokenizer.java
// From 'Thinking in Java, 3rd ed.' (c) Bruce Eckel 2002
// www.BruceEckel.com. See copyright notice in CopyRight.txt.
import java.util.Arrays;
import java.util.StringTokenizer;
public class ReplacingStringTokenizer {
public static void main(String[] args) {
String input = "But I'm not dead yet! I feel happy!";
StringTokenizer stoke = new StringTokenizer(input);
while (stoke.hasMoreElements())
System.out.println(stoke.nextToken());
System.out.println(Arrays.asList(input.split(" ")));
}
} ///:~
</Code>
- 3
- 64-bit JVM for Linux on Intel?Hi,
I'm looking for a 64-bit JVM for Linux on Intel, but it looks like Sun
doesn't offer one.
Am I just missing it, or are there really no 64-bit JVMs for Linux on
Intel?
Are there free alternatives?
Thanks.
- 4
- sprite & image - j2memidp 2.0
Java SE 5.0
J2ME version 2.2
I'm trying to create an image based on javax.microedition.lcdui.Image
I wish to fill the image with graphic created by the code and not use a real
image... because I want the image to change during program execution.... I
want the image to display a circle filled with a color... I guess there is
no such thing as a circle image so I thought first create a layer with
Alpha=0% (transparent) and then a layer above it containing the
circle...... - giving the impression of a circle image, the corners of the
image object melt into the background
I want this image to be put into a sprite
I'm not sure how to create such an image...
Please if you have any tips about this then tell me, and links to examples
solving this problem is very welcome :-)
Jeff
- 5
- hashCode for byte[]"Roedy Green" <email***@***.com> wrote in message
news:email***@***.com...
> What algorithm is used for hashCode for byte[]. Where do you look to
> see it? Do you have to invent your own wrapper class to get a decent
> one?
From section 10.7 in the JLS:
The members of an array type are all of the following:
- The public final field length, which contains the number of components of
the array (length may be positive or zero)
- The public method clone, which overrides the method of the same name in
class Object and throws no checked exceptions
- All the members inherited from class Object; the only method of Object
that is not inherited is its clone method
That says that the it uses the equals and hashCode methods from Object,
which are actually native methods and thus VM dependent but are usually a
permutation of the address of the object itself.
What Sun really needs to do is to define an interface like Comparable for
use with HashMap and HashSet. This interface would implement the methods:
equals( Object a, Object b )
hashCode( Object a )
This would allow you to establish your own criteria for when objects are
equal.
- 6
- Does object pooling *ever* make sense?I've read recently that object allocation in recent JVMs is so fast that
it doesn't make sense to create object pools. Just create a new object
when you need it and let the garbage collector do the work.
Does this hold true when your objects are very large, though? What if
your object contains a byte [] of length 100K? Or 1Mb?
What's the breakeven point beyond which it makes sense to reuse objects?
- 7
- Bug tracking tools for Java appWe're looking for a simple bug-tracking app. Jira looks cool, but it's not
cheap. Bugzilla looks complicated.
Any suggestions?
- 8
- JAVA NIOHello,
Somewhat new to JAVA, and I swear I have looked all over on this
problem, and found an answer, but it does not seem to work. I have a
non blocking NIO socket client connection I can send data to the
socket check the input buffer for data and handle it okay. If no
activity occurs in say 10 seconds, I do an input read. From reading
documentation, I would expect a 0 return value for a proper connection
with no data, a -1 return value or IOexception for a bad socket
connection. However, what is happening is that the socket connection
is still open on both sides, the read times out and generates an
IOexception error described as Read timed out. Does the JAVA examples
only work when the server is also a NIO object? I say this because
the server I am using is not written in JAVA. Any help or suggestions
would be greatly appreciated!
Thanks
Ryan
- 9
- Tomcat 5.5.X ready for production ?Hi
I need your advices and experiences !
Is Tomcat 5.5.X ready for production ?
I will add some new features to an application running currently on
5.0.X . I consider taking this opportunity to switch to tomcat 5.5.X ,
and at the same time to JDK 5.0 .
--
Jean-Marc Vanel
Consulting & Services / software development
OSS, Web, Java, XML ...
http://jmvanel.free.fr/ ===) CV, software resources
Computer science diary : http://jmvanel.free.fr/computer-notes.html
Worldwide Botanical Knowledge Base : http://wwbota.free.fr/
Test XML query engine: http://jmvanel.free.fr/protea.html
- 10
- how to detect platform?What I really want to do is set the look and feel according to
platform, win-lnf for windows, gtk-lnf for linux. I don't have a mac to
try it on, but the same for mac would make sense.
When I use getSystemLookAndFeelClassName() I still get the butt ugly
metal on linux, so I'd like some way to detect which platform I'm on so
I can set the lnf accordingly..
Also, does the gtk lnf work on Windows? I've tried with sun-jdk15 and
sun-jre15, none of which seem to have it.
- 11
- Can I put the business logic in Servlets and bypass EJB?The more I read from I find that EJB are not favored by many. And
it's not something I want to do unless I have to anyway. Is it
somehow wrong to to put my business logic in my servlet or a javabean
and not use Enterprise JavaBeans at all? That still looks like good
separation to me. I think it's MVC, but not sure. Still learning.
Thanks.
- 12
- Missing Stack Trace using log4jI am creating a custom log4j appender (extends AppenderSkeleton) to
record data into a previous developed logging system.
On occasion (18 times out of test order 120,000 executions) (not
reproducable, as of yet), I get the following message in my log file:
>> 160954.679:Notification Processor #4:INFO
com.datamodel.WorkOrder - CANNOT PROCESS PROPERLY
java.lang.NullPointerException
>> 160954.679:Notification Processor #4:INFO
....
the line prefixed with ">>" is the log header record.
My problem is that I do not know whether the NPE exception is generated
and reported in the appender or in the calling code; since there is no
stack trace printed.
Is there appender debugging tools or can someone offer a suggestion
here?
- 13
- Calculating download time based on bit rate.I have the bps rate that the document is downloading at, the size of
the the document, and how much has been downloaded but I cant seem to
calculate the ETA for it to finish (all I need for now it the time in
seconds.)
for a 9mb file it says 2 seconds left when that is clearly wrong
considering that it takes around 1 minute to finish.
private long getSecondsLeft(long bitRate, long received, long
size)
{
return (bitRate != 0 ? (size - received) / bitRate : -1);
}
- 14
- Cross-platform installer package?Does anyone know of a cross-platform installer package? Scanning
Google, it appears that the installer package landscape is all focused
on specific operating systems.
- 15
- How to integrate MsWord with Java Web Application and Linux ?Hi all,
We plan to develope Java web application and deployed in Linux web /
application server. But All the clients are using Windows. Here is our
requirement :
- From Java web application we will invoke MSWord on client side
- MSWord will access database on database server on Linux
(may be for mail merge etc)
I know for .Net application we can do that using VSTO.
But what if using Java and Linux (No windows / .Net server), what
approach can I do to get the functionality ?
Using VBA/Macro + Java Web Service , can we do that ? or any other way
?
Thank you very much for your help,
Krist
|
|
|