java

JSomething something = new JSomething().somethingelse;

I could swear I saw an object being created this way. What does somethingelse do? ...

Obtaining the camera rotation in radians on the X, Y, and Z axis in OpenGL?

Hi, I'm trying to obtain the camera rotation on various axis in OpenGL (but using Java, LWJGL, and jME specifically). The camera object allows me to get the direction as a Vector3f, but this doesn't seem to work to get the componentised rotation; each axis appears tied to another axis. I found that toAngleAxis with the angle component wi...

Hibernate and optimistic locking

I am new to hibernate just to mention but I know that it has optimistic locking support. I was searching all day and I wasn't able to find tutorial how to implement it in some basic application. So fore example I have this mysql table http://pastebin.com/m574200ce and I have this hibernate mapping file: http://pastebin.com/m2047dd98 (g...

nested methods

add and GetContentPane are methods Does this code access a method in a method? What does this code do? frame.getContentPane().add(BorderLayout.SOUTH, b); ...

Going from PHP Propel to Java Hibernate

Hi all! First post here... I normally develop using PHP and Symfony with Propel and ActionScript 3 (Flex 3), using AMF services. This weekend I'm trying my hand at creating a BlazeDS application using Java and Hibernate, and I'm beginning to like Java a lot!!! After some research this weekend and using the Hibernate Synchronizer plugin...

Window z-ordering in java

Is there a way to manage the window z-ordering of JDialog windows within java? I would like to able to assign each window to a layer such that windows on lower layers can never go above and obscure windows on higher layers. Even when they have focus. Similar to the Z-order capability that exists for components but for JDialog windows....

filling jComboBox in JAVA in Netbeans 6.5

Hi, i am a c# programmer thats wanna to learn java this days.So i was filling a combobox in ms visual c# by filling a datatable or dataset and showin DisplayMember(NAME) , ValueMember (ID) thats it .. i searched for binding jcombobox but google not helped me .. gimme an example for binding please. ...

Could I benefit from Spring with BlazeDS

I'm building a small experimental application using BlazeDS AMF, Java and Hibernate, and I was wondering if I could at all benefit from using the Spring Framework? Since I'm using BlazeDS, that acts as my controller, but I might use something like Aspect Oriented Programming for example for logging. What other benefits could I get from...

Best way to update in a db a list of mails

I have the following db schema. SQL> describe USERS; Name Null? Type ----------------------------------------- -------- ---------------------------- user_id NOT NULL NUMBER(38) name NOT NULL VARCHAR2(50) password ...

Why is BIGInteger in JAVA not responding for higher powers?

Hi, When I try to find the value of BigInteger data type for 2 to power 23,000, I am not able to see the value. Upto 2 to power 22000, I could display the biginteger value . I am on XP. Any solution/suggestion? Sastry ...

Using selenium.getBodyText() to capture HTML source, using Java, how can I save it into a HTML file locally?

This is probably a java noob question but here is my scenario: using selenium, I captured the html source with getBodyText() using java, I want to save the information from getBodyText() into a html file so I can review it later I currently have getBodyText() stored as a String, here's the code: String stored_report = selenium.getBo...

How to change command prompt (console) window title from command line Java app?

How to change and update the title of the command prompt window from the java command line application? Every time I run my application, the command prompt window title shows: C:\WINDOWS\system32\cmd.exe - java MyApp. I'd like to change and update the window title as the java program runs, for example as wget(win32) updates downloading ...

Retrieve Architecture from Java

Hi All, I'm writing a JNI application and I want the app to download the correct binary library for the current architecture. Is there any way to retrieve this information from code? I need to know where it's ARM, x86 or any other architecture really. Kind regards, Gavin ...

Java: How to decode HTML character entities in Java like HttpUtility.HtmlDecode?

Basically I would like to decode a given Html document, and replace all special chars, such as "&nbsp" -> " ", ">" -> ">". In .NET we can make use of HttpUtility.HtmlDecode. What's the equivalent function in Java? ...

How can I set a window's caption on the Java SE platform?

I want my program to change its window's caption in response to various user actions. Does the Java SE platform offer a portable way to change the main window's caption at runtime, or do I have to resort to native API JNI calls? ...

How to pass a class object from Scala to Java?

I'm trying to use a Java class library from Scala code. (JGraphT, to be precise.) One of the constructors I need to call is public class SimpleGraph<V, E> extends AbstractBaseGraph<V, E> implements UndirectedGraph<V, E> { public SimpleGraph(Class<? extends E> edgeClass) {...} } To call this from Java, I would say: Undirec...

compare an object to null!!

I am trying to verify whether an object is null or not and i am using this syntax: void renderSearch(Customer c){ System.out.println("search customer rendering>..."); try { if(!c.equals(null)){ System.out.println("search customer found..."); }else{ ...

How to surround code with try/catch most elegantly

I often have some problems when using try-and-catch: 1) Some variables need to be declared inside the try brackets otherwise they will not be in scope 2) Ultimately even my return statement ends up having to be in the try bracket but then the method doesn't return anything. What is the proper way to get around this sort of problem. A...

Can pack200 be used to compress class files to run on jdk 1.4?

I would like to compress a jar file as much as possible for distribution (for downloading over dial-up modem). Can pack200, which was included in jdk5, be used on pre-jdk5 class files? To clarify, the target environment is jdk 1.4.x. ...

Java AppEngine: JDO or JPA, How to choose??

Pros and Cons of choosing JDO or JPA for a Grails Application that will run on Google AppEngine ...