 |
 |
Index ‹ java-programmer
|
- Previous
- 3
- log4j - openning a new fileHi,
I need to open a new log file in a specific location in the code, how
can I do that?
Log file size and number of records are unknown so I cannot use this
information.
- 5
- Make Java plugin SysTray icon visible ?I have a java plugin (for IntExp) browser which is currently for version 1.4.2_14b05
On some machines I noticed that the plugin shows an icon in the SysTray
on others not. How can I hide/unhide this Java plugin SysTray icon ?
Where are the files for this java plugin physically stored (in which directory) ?
Lars
- 6
- Instant dragging from JTreeHi NG,
I cannot drag an unselected element of a JTree. First I have to select
it, then I can drag it. Is there a way to implement that? I think I can
spare that extra click.
Best regards, Christoph
- 6
- Creating MouseEventsHi,
I'm trying to dispatch interaction with a touch screen as a MouseEvent, but
I can't get java to register an event on components like the drop-down list
from a combo box, or invisble components that accept normal mouse click
events.
Thanks,
Andrew
- 6
- java with swinghello to all,
I have done a java component in Swing
I have included the java component as plugin and
embedded in applet for web based access. But it is not
visible in other clients.
It is visible in Only the server.
I read javaweb start's JNLP can do that (since I
didnot want to install anything jre like in client )
is it possible.
thank you in advance,
vishnu.
- 9
- Reading data from a file using AntHi Everyone,
Im new to Ant and I am encountering some problems.
I have a text file which contains a value in there. I need that value
to be set into another file.
I tried using Javascript but Javascript does not support I/O for files.
Is there any command in Ant that can read a value from a text file (
eg. output.txt ) and then use that value to replace into another file (
eg. jsp ).
Thanks,
Marvin
- 9
- jsp:setProperty, java.io.File, and I thoroughly confusedHi,
I'm writing a webapp based on JSP technology. I've been doing
some reading and from what I've read, it isn't possible to use
jsp:setProperty to set a File property. So, I created a BeanInfo class
for the Bean I had the File variable in. I also created a class that
extended PropertyEditorSupport to assign the BeanInfo class to the
Bean. But, those don't appear to get called. I CAN, however with
Tomcat 5.0.28 on Windows XP, simply set a File property with
jsp:setProperty. The Bean ends up looking for the file in the Tomcat
bin directory, and I can thus set a relative path to the file. So, I'm
completely confused. What is going on? Is this expected behavior?
Thanks,
Jason Mazzotta
- 10
- 13
- Corrupted JPEG: DataInput/OutputStreamHi!
I download a JPG and write it to disk; this is rather old code which
certainly worked. The only thing I'm aware of that changed is JDK 1.4 ->
1.5b2. The written file is corrupt:
URL u = new URL ("http://foo/bar.jpg");
DataInputStream in = new DataInputStream
(u.openConnection().getInputStream());
File f = new File (foo);
FileOutputStream fs = new FileOutputStream (f);
DataOutputStream out = new DataOutputStream (fs);
for (int b; (b = in.read ()) != -1;)
{
out.write (b);
}
in.close();
fs.close();
out.close();
What's wrong? And, can I repair the corrupt files?
- 13
- 15
- illegalMonitorStateExceptionhello everybody!
it is well known that one has to be in the monitor of an object to call
myObj.wait(), f. E. by putting it into a synchronize(myObj) block.
my questions:
- is it bad programming style to just catch the exception without doing
the synchronize? because if i do this my program still perfectly does
what it should.
- why does this exception exist?
thanx a lot,
moritz.
- 15
- Java Developer - Oracle, UML, Spring, Hibernate -HOT HOT OPENINGSTitle: Java Developer - Oracle, UML, Spring, Hibernate
Company: Trinity Consultancy Services
Skills: Java Developer, Software Engineer, Java Programmer, Software
Developer, Software Programmer, Java Engineer, UML, Hibernate, Spring
- Java Developer, Software Engineer, Java Programmer, Software
Developer, Software Programmer, Java Engineer, UML, Hibernate, Spring
Trinity Consultancy Services is seeking applications from qualified
and experienced software engineers with above skills for various
requirements with their Clients.
Job description and Skills:
* Java Developer, Software Engineer, Java Programmer, Software
Developer, Software
* Programmer, Java Engineer, UML, Hibernate, Spring
* Java Developer- Oracle, UML, Spring, Hibernate
* 4+ years of Java experience
* Oracle expertise
* Knowledge of Spring and/or Hibernate and/or Tapestry
* UML experience
* Experience in creating database intensive applications from the
ground up
* Full life cycle software development
* Design and deliver complex web applications
Trinity Consultancy Services is a leading source of Information
Technology, Engineering and Management Experts that corporations of
all sizes turn to, from Global 2000 corporations to mid-sized and
small organizations nationwide. With the commitment to excellence, is
subtly managed to find, recruit, screen, submit and effectively
organize a technical workforce anywhere in the United States for
various Technical needs of corporation irrespective of its size.
Trinity Consultancy Services is one of its unique kind of the leading
information technology consulting services, and business process
outsourcing organizations committed for excellence.
Trinity provides business consulting, systems integration, application
development, staffing services and managed services to Global 2000
Corporations, medium-sized businesses, and government organizations
throughout the United States.
Trinity can mobilize the right resources, skills and technologies to
enable our clients to reach their dreams by enhanced performance. With
deep industry and business process expertise and broad global
resources, Trinity Consultancy Services is committed for excellence.
Please contact our Human Resource Manager Ms. Ann and send your
detailed Resume with your work authorization status, current salary
and expectations.
Mention the position you are applying in the subject line.
Email: email***@***.com
www.trinityconsultancy.com
- 15
- Interested in ai project in java ??hi, anybody interested in long term artificial intelligence software
project to develop an intelligent bot for stock market trading in india
?, the project is to be implemented in java using the bea weblogic
application server platform on almost all paltforms
(windows/linux/solaris/bsd), with a capability of handling the trading
accounts of thousands of clients with their perferances. if u r
interested plz let me know. i will put all the project requirements and
tools and programming languages required for the project in my project
page at http://www.aistockbot.ravichoudhari.worldfreeweb.com after 22nd
jan 2k6. if u r interested then send me a mail at
email***@***.com.
- 15
- getting starting with ...... Java
I am newbie of sorts: I'm familiar with java to a some extent, but I have
never had the chance to use it. Which means, I'm not as comfortable with
it as I am with other languages (php,asp,python,c,perl,etc). What is the
best way to get comfortable? Is there any particular direction I should be
heading? I never read a book from start to end, unless it's a novel, so
with other programming languages I've learnt the fundamentals, and the
bits and pieces here and there as needed. Database connectivity, web
(server based) apps are of interest as most work I do is related to these.
Current projects include pulling stats from a database (Postgres,mysql) in
python and, a web credit card payment system in php. Im also maintaining
one of our "legacy" systems in perl.
I have lots of time, and I want use doing something productive in java,
that is my aim.
Directions will be helpfull....
--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
- 15
- Eclipse 3.08 problemEclipse show not problems, it means when I write code must every time
rebuild to view compiler errors.
How it fix?
|
| Author |
Message |
palmis

|
Posted: 2006-1-29 17:57:00 |
Top |
java-programmer, thread status jdk 1.3
How can I know thread status with jdk 1.3?
It doesn't have thread.getStatus().
How can I do?
Thanks
Palmis
|
| |
|
| |
 |
Sanjay

|
Posted: 2006-1-30 0:19:00 |
Top |
java-programmer >> thread status jdk 1.3
palmis wrote:
> How can I know thread status with jdk 1.3?
> It doesn't have thread.getStatus().
Isn't it thread.getState()
but this API is
Since:
1.5
I can think of isAlive() API in previous versions.
> How can I do?
>
> Thanks
> Palmis
Sanjay
|
| |
|
| |
 |
palmis

|
Posted: 2006-2-1 16:10:00 |
Top |
java-programmer >> thread status jdk 1.3
Thank you very much.
Palmis
|
| |
|
| |
 |
| |
 |
Index ‹ java-programmer |
- Next
- 1
- JNI: Accessing value in an arrayI have a code::
jobject headerVal;
//jsize size = 0;
jclass objClass;
jmethodID mid = NULL;
void * headval;
do
{
/* after this call, headval will contain a pointer to an array.and
HeadID will contain an int value.*/
GetValue( headval,headdID);
if(headval)
{
objClass = (*env)->FindClassenv, "Ljava/lang/Object;");
if(objClass == NULL)
{
break;
}
mid = (*env)->GetMethodID(env, objClass, "<init>", "(J)V");
if(mid == NULL)
{
break;
}
if(headID>0x30 || headID < 0x3F)
{
headerVal = (*env)->NewObject(env, objClass, mid,(jstring)headval);
}
else if(headerID>0x70 || headerID < 0x7F)
{
headerVal = (*env)->NewObject(env, objClass, mid,(jbyteArray)headval);
}
else if(headerID>0xB0 || headerID < 0xBF)
{
headerVal = (*env)->NewObject(env, objClass, mid,
(jbyte)headval);
}
else if(headerID>0xF0 || headerID < 0xFF)
{
headerVal = (*env)->NewObject(env, objClass, mid,
(jlong )headval);
}
}
}while(FALSE);
return headerVal;
}
I know it is not the correct way to assign headerVal. how can i assign
the value contained in array pointed by headval???
I am a beginner in c and dont know much abt pointers...
please do help me...
- 2
- Converting String<->byte[] -- No Data Loss?If I have a byte[] and I convert it to string (String sData = new
String(byte[] bData), then convert it back (byte bData = sData.getBytes()),
will all data be intact, or do Strings have problems with bytes that are
not printable characters? I've tested this and it seems to work fine, but
I want to make sure there isn't some condition or situation I'm not aware
of that could cause problems.
I'm doing this because it's easier to do some of my work with strings, so
I'm reading a Zip file, saving each entry as a String, modifying some, then
saving it as a new Zip. I've found with Zip files, you can't always be
sure of how much data you'll be able to read in, so I'm reading in data in
blocks upto 2k, then taking each block and converting it to a String, so I
can concatenate the amount read in onto the end of another string. (With
Strings, I can use sString.substring(), I can't find a way to concatenate
byte[] arrays without continually creating a new array and using
System.arrayCopy().)
Thanks for any info.
Hal
- 3
- struts html:checkboxHello
I have a following problem. I want to have both checked in unchecked
checkboxes on my jsp according to values i give them but i dont know how to
force chceckbox that it will be chcecked. I read somewhere that it
corresponds with ActionForm. But how can i set it up before that affect this
checkbox later in form?? I should put it in session ?it doesnt work. when
form is displayed i thought that always a new ActionForm bean is created. So
when can i change values in this bean?? Please help
Marcin Goldyn
- 4
- Hiding table columns?Hi,
I'm no professional programmer, but I suppose I know enough about the
Table API to do most of the things I need. Now I'm trying to figure
out a good way to implement a functionality into my apps to toggle the
visibility of table columns.
I wonder if anyone here can provide some tips on how to handle this as
the TableColumn class doesn't seem to provide a setVisible() method.
All my tables use a TableModel, so I suspect that's where I need to do
most of the stuff. I'm thinking of setting up some kind of
two-dimensional array to hold the column names, and a visibility flag
for each column. In the TableModel methods I could then use that flag
to determine what columns and data should be processed.
Any help is much appreciated.
--
Luc Van Bogaert
- 5
- Eclipse Javadoc Auto-Formatting: HTML Tags Trailing Spacecomp.lang.java.softwaretools -
I've been using Eclipse for a few years and am currently using 3.1. I've
noticed that whenever I include an anchor (<a>) tag in my Javadoc, the code
formatter always adds a trailing space before the closing tag. E.g.
Before: Go <a href="http://www.google.com">here</a>.
After: Go <a href="http://www.google.com">here </a>.
It doesn't happen with the <code> tag, and I'm hoping that it's configurable
somewhere. It's doesn't appear to be an option in the main Code Formatter
interface.
Thanks,
Josh
--
Josh
- 6
- JDK 1.5.0_05 won't load applets from the Internet?I'm setting up a new PC with a brand-new installation of Windows XP and
Fedora Core 3 (each with all the latest updates).
I'm having trouble with the Java plug-in: it won't load any applets
from the Internet (from the local filesystem works fine). I'm behind a
SOCKS v4 proxy; the browsers and DNS are configures appropriately and
surfing the net works fine, using Mozilla and IE under Windows and
using Mozilla under Linux -- but trying to load a page with an applet
just displays the pretty coffee mug image where the applet should be,
and when I try to leave the page, the browser hangs, presumably because
the JVM is stuck trying to download the applet.
I tried reconfiguring the gateway to use plain NAT, so I could take the
proxy out of the picture, but this did not fix things.
I never had problems like these with JDK 1.4.2.*, but with 1.5.0_05, I
just can't get it to work at all. Web Start doesn't work either -- just
sits there "checking for latest version" indefinitely.
I have Java configured to use the browser's settings; configuring the
proxy settings manually makes no difference. (Of course when I use NAT
on the gateway, there is no proxy involved at all, but that does not
work either.)
N.B. The applets themselves do not appear to be the problem -- I tried
some really simple ones, including samples from the Java Tutorial;
nothing even gets pulled across the network.
I'm hoping someone can shed some light on this -- I'm stumped!
Thanks,
- Thomas
- 7
- ANNOUNCE: Ice 2.0 releasedHi,
we've just released Ice 2.0 with quite a lot of new features:
- new language mappings for Visual Basic and Python
- a new light-weight and super-efficient firewall
- a streaming API that allows you to control the encoding and decoding of
objects in arbitrary formats (or the native Ice format)
- dynamic invocation and dispatch interfaces, so you can write generic
clients and server that do not require compile-time type knowledge
- new chapters in the documentation for the new features
- numerous other improvements and bug fixes
See http://www.zeroc.com/vbulletin/showthread.php?s=&threadid=987
for more info.
Cheers,
Michi.
- 8
- Anonymous inner Classes accessing final variables?Hi
When a write an inner class inside a method , it can access the
variables in the enclosing method if and only if they are final ...
Why is the compiler enforcing this ??
What might be the reason for java doing this ?? Is it that these Local
Variables will be cached for Inner class usage ??
Thanks a lot in advance!
- 9
- Protected inner classes and inheritanceApologies if I am missing something obvious, but here's the situation. I have
a top-level class with a protected inner class. I have a second-level class
in a different package that extends the top-level class. For example:
package somePackage;
public class TopLevel
{
protected class Inner
{
protected int intField = 0;
protected Inner()
{
// constructor
}
protected void innerMethod()
{
return;
}
}
}
package somePackage.otherPackage;
import somePackage.TopLevel;
import somePackage.TopLevel.Inner;
public class SecondLevel extends TopLevel
{
public SecondLevel()
{
// constructor
}
public void someMethod()
{
Inner inner = new Inner();
inner.intField = 1;
inner.innerMethod();
}
}
When I compile the second class, I get at least 4 errors:
The type somePackage.TopLevel.Inner is not visible
The constructor TopLevel.Inner() is not visible
The field TopLevel.Inner.intField is not visible
The method innerMethod() from the type TopLevel.Inner is not visible
I thought I read the Java docuementation clearly when is says
"The protected modifier specifies that the member can only be accessed within
its own package (as with package-private) and, in addition, by a subclass of
its class in another package."
and
"You can use the same modifiers for inner classes that you use for other
members of the outer class. For example, you can use the access specifiers --
private, public, and protected -- to restrict access to inner classes, just as
you do to other class members."
If I simply make TopLevel.Inner a public class, the errors go away. But I
don't really want to do that... Anything obvious??
thanks
scott
- 10
- weird exception during start of applet... (J2SE5)Hi,
does somebody have an idea what the exception:
java.lang.NoClassDefFoundError: IllegalName: <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
at java.lang.ClassLoader.preDefineClass(Unknown Source)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at sun.applet.AppletClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at org.xml.sax.helpers.NewInstance.newInstance(Unknown Source)
at org.xml.sax.helpers.XMLReaderFactory.loadClass(Unknown
Source)
at org.xml.sax.helpers.XMLReaderFactory.createXMLReader(Unknown
Source)
at Graph.init(Graph.java:465)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
mean?
The weird thing is, i have two pages on the first one i get this
exception
and on the other one, the applet work.
Check it out
not working -> http://www.stephan-zehrer.de/LiveGraph
working -> http://www.stephan-zehrer.de/html/graph/
They both uses the same jar file.
What's wrong?
thx
Steve
- 11
- type Map does not take parameters ?Hi all,
I got a strange error message from the java 1.5.0 compiler:
"type Map does not take parameters" which Map certainly does.
The complete code was this mini class:
import java.util.*;
class AAA {
public static void main(String[] args) {
Map<Integer, String> map = new HashMap<Integer,String>();
System.out.println(map);
}
}
NB, it does not compile with the original compiler, but compiles happily
within an Eclipse 3.1 environment.
And it does also compile with the original compiler when I change the
reference type from Map to HashMap.
How can this be?
Yours,
Bu.
- 12
- operator precedance: new MyClass.method()Hi,
According to the operator precedence table, the dot operator has a higher
precedence than the 'new' operator:
http://java.sun.com/docs/books/tutorial/java/nutsandbolts/expressions.html
Therefore when I write
new myClass.method()
it should, according to this table, be parsed as
new (myClass.method())
which is nonsensical and doesn't compile.
It seems to be parsed as this instead:
(new myClass).method()
Is there an explanation?
****
sample code:
****
public class C {
public int i = 0;
public C(int i) {
this.i = i;
}
public int getI() {
return i;
}
public static void main(String args[]){
System.out.println(new C(20).getI());
// is parsed as:
//System.out.println( (new C(20)).getI() ); ==> ok
// but according to precedance table should be parsed as:
//System.out.println( new (C(20).getI()) ); ==> wrong
}
}
--
Rob
- 13
- Please Please Help!!WocBSe1QFHLRlEH2Ki+Gl8DIjHmu9wcQ
Hi all,
Dont know if this is the right place to submit questions. but i need
help :(
I need to convert this pl/sql function to java function so that i can
use it my jsp page.
FUNCTION countItem(adminUser IN STRING,
m_menu IN NUMBER)
RETURN NUMBER IS
cno NUMBER := 0;
CURSOR cAdminMenu(adminUser VARCHAR2 ) IS
SELECT M.menuid,G.pageid,M.description,G.name,G.url
FROM useraccess P, pages G, menues M, submenues T
WHERE P.userid = adminUser
AND T.menuid = M.menuid
AND T.pageid = G.pageid
AND P.pageid=G.pageid
AND G.publicaccess = 'N'
UNION
SELECT M.menuid,G.pageid,M.description,G.name,G.url
FROM groupaccess P, pages G, menues M, submenues T
WHERE P.grpid IN (SELECT GRP_ID FROM GROUPUSERS WHERE USR_ID =
adminUser)
AND T.menuid = M.menuid
AND T.pageid = G.pageid
AND P.pageid=G.pageid
AND G.publicaccess = 'N'
UNION
SELECT M.menuid,G.pageid,M.description,G.name,G.url
FROM pages G, menues M, submenues T
WHERE T.menuid = M.menuid
AND T.pageid = G.pageid
AND G.publicaccess = 'Y'
ORDER BY 1,2;
BEGIN
FOR t IN cAdminMenu(adminUser) LOOP
IF t.menuid = m_menu THEN
cno := cno + 1;
END IF;
END LOOP;
RETURN cno;
END;
I would really appreciate your help.
Regards,
Ayeda
- 14
- refactoringPatricia Shanahan <email***@***.com> writes:
> Roedy Green wrote:
>> I have always felt that a if a method can have multiple inputs it
>> should be able to have multiple outputs, but very few language
>> designers (Forth and PostScript being exceptions) have agreed.
>
> Matlab is another exception.
As is Common Lisp.
Regards,
Patrick
------------------------------------------------------------------------
S P Engineering, Inc. | Large scale, mission-critical, distributed OO
| systems design and implementation.
email***@***.com | (C++, Java, Common Lisp, Jini, middleware, SOA)
- 15
- Eclipse Plug-insI have installed Eclipse 2.0.2. In working through the tutorial I came
upon "Creating Your First Java Project." Step #5 says this:
Click the Browse button next to the Zip file field and browse to
select
<workbenchRoot>/plugins/org.eclipse.jdt.ui.examples.projects/archive/junit/junit37src.jar.
Note: This step assumes that the JDT example plug-ins have been
downloaded and installed.
The closest thing within the IDE is this:
<workbenchRoot>/plugins/org.eclipse.jdt.ui
I have looked all through the Eclipse website. I have found several
plug-ins but not this set. Can anybody point me in the right
direction?
Bob
|
|
|