java

convert a two Byte bit mask into a EnumSet

I am reading a binary file that has values stored in bit masks, both 1 Byte bit masks and 2 Byte bit masks. Each bit in the masks act as a switch that indicates where an Event has transpired. Example of 1 Byte mask: 00000101 Indicates that Event one and Event 3 has transpired. Example of Enum public enum MyEnum { ...

Can a Class in Java determine if it has been modifier?

I have, a Starter.class which updates some classes when needed, then instantiate and runs a Client class. Is it possible (if yes, how) for the instance of Class to know if it has been modified since the last call? The modification is only a minor one and most of the methods stay identical. May be getting the date of last modification ...

Recursive Palindrome Test with java

I have the following homework assignment: I need to create a program that recursively tests in a word or phrase is a palindrome. Here is the prompt: A palindrome is "a word, line, verse, number, sentence, etc., reading the same backward as forward, as Madam, I'm Adam or Poor Dan is in a droop." (dictionary.com) When evaluating palin...

Java Thread related question

Class Ui{ synchronized update() { do something } synchronized stop() { do something } } Multiple threads are accessing the methods of the above class.. RunnableUI rm1 = new RunnableUI(); RunnableUI rm2 = new RunnableUI(); Thread rmt1 = new Thread(rm1); Thread rmt2 = new T...

Overview of how to develop LBS/GIS app in Java

I need to develop a location based extension to an existing app that will allow users to see all other users that are around them (within a fixed aerial distance). The existing app was developed using Axis (Web services) + Spring + Hibernate + MySQL. Requirements are: Java framework (preferably open-source unless commercial solution ...

How do I configure proxy settings for Java in Solaris?

I would like to configure Java proxy settings on Solaris to use a proxy script. I have found instructions for making the settings on a Windows machine using the Java control panel, but am having trouble finding where/how to make the same setting changes on a Solaris Java install. I would like to use the proxy script, rather than manu...

downcasting an array in java (remove the unchecked warning game)

Hi all, I have a dumb silly question, but sometimes you have to ask them anyways. I got an Object[] instance in my left hand (it comes from non-generic swing) and a method that accepts a let's say Integer[] as its argument (in my case it's actually a vararg) in my right hand. I'm sure of the content of the array (or I'm ready to pay t...

How to Tell if a Thread Pool is Idle in Java

I have a thread pool created using java.util.concurrent.ThreadPoolExecutor Is there anyway I can wait till the pool is idle? By which I mean all the threads are not running and nothing is waiting in the queue. I searched the web and all the solutions don't work for me. For example, I don't want shutdown the pool so awaitTerminatio...

Find a jar file given the class name?

This must be a very basic question for Java developers, but what is the best way to find the appropriate jar file given a class name? For example, given "com.ibm.websphere.security.auth.WSSubject", how do you track down the appropriate jar file? ("google" is not the answer I'm looking for!) The java docs do not give any hint of the jar...

checking if a file locked in java

Hello, I plan my java program to read a file which can be locked by another program to write into it so I need to check if the file is locked, if so wait until it is free and execute X function when free. How to achieve this? ps: the enviroment that my java program will run will be a Windows 2000 server ...

ADF Faces 11g ignores the template when it navigates to the same page

Hi, I'm using ADF Faces 11g\JDeveloper 11g to develop a web application and using Weblogic 10.3 to deploy it. I'm having some issues when I navigate to the same JSP page. Example: I have a page using a template: <f:view> <af:document id="d1"> <af:form id="f1"> <af:pageTemplate viewId="/base/te...

Possible to launch JWS applet within browser instead of standalone?

Is it possible to embed an applet in HTML so that it will be displayed within the browser window yet launched through Java Web Start via a JNLP file instead of using the browser's Java plugin? If so, how is this done? I've only been able to launch my applet in a standalone window, but disliking the user experience pop-ups create, I'd p...

How to create new folder on POP3 protocol

I want to create a folder with the name "Spam" by using Javamail Api, but I'm not allowed to create any folder on POP3 protocol. What should I do? ...

How to obtain CURDATE() / NOW() on a JPA named query?

I want to do a select from table where date = TODAY, on mysql that would be "where date > CURDATE()", how do I do this on a JPA named query? ...

Translate vector by matrix

I have a 4*4 matrix and a 3d vector. I need to translate my vector by the matrix. Not too much crazy maths notation please because i dont understand it. An example in something close to java would be fab! Thanks ...

editing a java bean ?

Hello, I'm searching for he source of a graphical bean editor... a (very basic) beanbox if you prefer... Here is what I would like to achieve : I have an application which uses some customizable objects that more or less honor the java bean spec... What I mean by that is that they have getters and setters for most properties... The sw...

web applications -- where to start?

Hi, i'm fairly new at webapp development in java and have been looking around for a decent tutorial on this subject. I've found a whole bunch of frameworks from struts to seam. Which framework should i look at considering my level of expertise in this area is fairly low? Also is there a global tutorial on web application fundementals...

Loading a collection of Enums with Google app engine datastore

I am using the Goole app engine datastore with Java and trying to load an Object with a List of Enums. Every time I load the object the List is null. The object is @PersistenceCapable(identityType = IdentityType.APPLICATION) public class ObjectToSave { @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) pr...

Java observer and observable

Can anyone explain why the update method on printobserver is not being called when I click the button on this JFrame? import java.awt.BorderLayout; import java.awt.Frame; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.File; import java.io.IOException; import java.net.InetAddress; import java.net....

Eclipse 3.5 Unable to install plugins

Hi, I really don't know what's going on with Eclipse 3.5 (3.5.0 or 3.5.1, same issues), but it's been now 2 days that I'm struggling with Eclipse to find a way to make the plugins installation work via the "Install New Software screen"!!! I have visited a lot of forums and blogs, tried many solutions but in vain: each time the current p...