java

Interacting With Java Applet

Does anyone know if it is possible to interact with a java applet via .net? Edit: I was able to use the UI Automation framework to locate the java applet, and from there use OCR to read data and simulate mouse/keyboard input into the applet. ...

Using JNA to link to custom dll

Hi, how do I access custom .lib / .dll functions using JNA? Can someone provide an example? Thank you. ...

JspWriter write versus print

I'm developing some custom JSP tags. In my SimpleTag.doTag() I grab the JspContext and call getOut() to get the JspWriter. When writing to JspWriter, what's the different between write(String) and print(String)? Should I be calling one instead of the other? ...

C# vs Java Garbage Collector

Hi There Does anyone know the major differences between the Java and C# garbage collectors? A web search has not revealed much, and it was a question that came up in a test. Thanks, Mike ...

Java: No interface implementation?

Today I got my book "Head First Design Patterns" in the mail. Pretty interesting stuff so far, however I do have a question about it's contents. I have no Java/C# background nor do I wish to jump into those languages right now (I'm trying to focus on C++ first). In the book is said that java does not have an implementation for interface...

How to run Eclipse 3.4.1 on MacOS 10.5.6?

Hi, I am trying to run Eclipse 3.4.1 on MacOS 10.5.6? I think I am using java 1.5 when I run eclipse: $ which java /usr/bin/java $ java -version java version "1.5.0_16" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16-b06-284) Java HotSpot(TM) Client VM (build 1.5.0_16-133, mixed mode, sharing) And then I click eclips...

Eclipse doesn't remember source lookup path

For some reason Eclipse doesn't remember source lookup path for some java projects, and every time during debugging (after redeploying) I need to press "Edit source lookup path" button and add current project to the list. Does anyone know how to make it remember selected source location? EDIT: It is a tomcat project, built with ant. Ec...

How can I profile file I/O?

Our build is annoyingly slow. It's a Java system built with Ant, and I'm running mine on Windows XP. Depending on the hardware, it can take between 5 to 15 minutes to complete. Watching overall performance metrics on the machine, as well as correlating hardware differences with build times, indicates that the process is I/O bound. It a...

Boolean expressions in Java

Hello, I have a question about the meaning (evaluation) of Boolean variables in return statements in Java. I know that: if (var) { ... } is the same as: if (var==true) { ... } In the second case we explicitly say var==true, but we don't need to do this, because Java evaluates var as true anyway. I hope I have understood this righ...

How to create a scrollable JPopupMenu

I am trying to create a JPopupMenu that has a scrollbar so that I can display a large number of items. There are a couple of implementations on the web that all have problems: http://forums.sun.com/thread.jspa?threadID=5128630 Looks correct (except for issues with separators) but if you scroll it the highlighting and selection no lo...

Make a negative number positive in Java

Hi, I'm sure this is a very simple question! I have a Java method in which I'm summing a set of numbers. However, I want any negatives numbers to be treated as positives. So (1)+(2)+(1)+(-1) should equal 5. I'm sure there is very easy way of doing this - I just don't know how!! Any tips would be much appreciated. ...

How to output a binary document based on a HTML document using filters in Java

This may be a little confusing but I having some trouble. My goal is to take an input HTML document and then process that document and use the HTML data to output a image document. For example, a user will request a URL, with some action=png in the querystring and then the filter will get invoked for the URL and output image document. ...

What happens if I don't include a db driver when using JDBC?

I'm new to java development, and was happy to see how much easier the database implementation was when it comes to supporting several platforms, compared to the php environment I'm used to. There is, however, one thing I'm confused about - I read everywhere I have to do a runtime-include of the database driver I want to use, ie: Class....

skeleton app for swing

I'm starting a simple project in swing but i don't want to start from scratch i'm searching a basic starting point with toolbars, file menu and basic functionality that works (exit from the application, button toolbar with a simple actionListener ...). I know there are eclipse rcp and the netbeans one but they are too big for my project....

JBPM: Multiple transitions going out from a Task Node

in JBPM, can I have (technically) multiple transitions going out from a Task Node? If Yes, is it a good practice? Any help would be useful. ...

Java: how do I check if a Date is within a certain range?

I have a series of ranges with start dates and end dates. I want to check to see if a date is within that range. Date.before() and Date.after() seem to be a little awkward to use. What I really need is something like this pseudocode: boolean isWithinRange(Date testDate) { return testDate >= startDate && testDate <= endDate; } Not...

Why doesn't Sun do a C# to Java byte code compiler?

We Want to Run Our C# Code on the JVM My company has a large C# code base. Well over half of this code is our core engine for creating, reading, modifying, calculating and writing Excel workbooks. We frequently get questions from customers and potential customers asking whether we are going to build a Java version of our engine - many o...

Fake X11 display?

I have a Java program using AWT which I would like to run on a headless system. The display for the program does nothing other than display stats. When the program finishes, it exits. There is no user interaction on the display. The program creates an output file which I use in my build system. Is there a way to get the Java program to ...

how to get the memory used by a java process in java

Hi, I am running JBOSS server by deploying my own classes.Now i started doing some operations on my application.Now i would like to know the memory used by my application before and after performing operations.please support me in this regard ...

How to enumerate IP addresses of all enabled NIC cards from Java?

Short of parting the results of executing ipconfig, does anyone have a 100% pure java way of doing this? ...