java

How can you organize the code for a game to fit the MVC pattern?

Hi all, I'm a freshman in college going for my computer science degree... I've programmed plenty the last several years but just lately I've been getting more into theoretical ideas about organizing code, design patterns, differences in languages, etc. I have a Java class, so I've dropped my C++ research/development and moved into Java...

3D scene-graph library for Java?

I'm looking for a reliable 3D scenegraph API for Java with good documentation, an active community and a license that allows for commercial use. I ruled out com.sun.scenegraph because it's GPL (and seemingly dead), Java3D because of this post and JMonkeyEngine because of this post. Any ideas? ...

how to convert hex to byte for the following program?

public static String asHex (byte buf[]) { StringBuffer strbuf = new StringBuffer(buf.length * 2); int i; for (i = 0; i < buf.length; i++) { if (((int) buf[i] & 0xff) < 0x10) strbuf.append("0"); strbuf.append(Long.toString((int) buf[i] & 0xff, 16)); } return strbuf.toString(); } ...

Finding Memory Usage in Java

Following is the scenario i need to solve. I have struck with two solutions. I need to maintain a cache of data fetched from database to be shown on a Swing GUI. Whenever my JVM memory exceeds 70% of its allocated memory, i need to warn user regarding excessive usage. And once JVM memory usage exceeds 80%, then i have to halt all the da...

How to bind a PImage to a texture in Processing using jogl (straight OpenGL)

If you've loaded an image into a PImage in Processing, what's the best way to bind it to a texture using OpenGL calls? I'm not using any of the Processing rendering stuff. ...

Regarding use of a wizard in a swing application

I am using the code given here to create my own wizard application. The basic motive of moving from 1 screen to other is achieved with this. But now I am stuck at a point. The problem is... suppose I have entered some value on screen1 and then I move to screen2.. and on basis of values entered in screen1 I have to display some values o...

Real-time Java graph / chart library?

There was an earlier thread on Java graph or chart library, where JFreeChart was found to be quite good, but, as stated in its FAQ, it's not meant for real-time rendering. Can anyone recommend a comparable library that supports real-time rendering? Just some basic xy-rendering - for instance, getting a voltage signal from data acquisiti...

What is the best way to develop a screensharing/presenting app in java or c++ using RTP?

I am trying to build a server sided HTML rendering based browser much like skyfire. I am evaluating the technologies that I would need to build this. When a user types in a www.yahoo.com on the client box, there is a session started on the server, then i grab the screenshots and send them in a RTP stream back to the client. To do the RTP...

Switch to Java from PHP/Ajax in 45 days (or so)

Because of the nature of new project we are about to start, I need to get into Java world rather quickly. I have about 8 years of PHP experience, and about 3 year in Javascript. (CI, Kohana and my own MVC framework) I have solid knowledge of OOP (as much as you can get from PHP/JS and little ActionScript & python here and there) So i...

Joptionpane popup window

Hi,i'm reading data from serial port for that i've created one window.when i click connect button i'll get another window showing message as "connected" with ok option and at the same time data starts coming but it wont dump until i click ok button of the front window,i want data should dump without clicking the ok button of the front wi...

Generate Images for formulas in Java

Hi I'd like to generate an image file showing some mathematical expression, taking a String like "(x+a)^n=∑_(k=0)^n" as input and getting a more (human) readable image file as output. AFAIK stuff like that is used in Wikipedia for example. Are there maybe any java libraries that do that? Or maybe I use the wrong approach. What would yo...

Fast Java library for circle recognition

Hi! I'm looking for a Java library for circle recognition in a supplied bitmap. My Java knowledge is too basic to implement eg. Hough transform efficiently (Java newbie). Thanks! ...

Cannot locate 'org.springframework.security.annotation.Jsr250MethodDefinitionSource'

When I configure method security under Spring Security I get the error shown above (see stack trace below). I am running Spring 2.5.6, Spring Security 2.0.4 under Eclipse 3.4 with a Tomcat 6 runtime. I need any suggestion as to what to look at to get this working. My security configuration file is as follows: <beans:beans xmlns="http:/...

Hibernate : Foreign key constraint violation problem

I have a com.mysql.jdbc.exceptions.MySQLIntegrityConstraintViolationException in my code (using Hibernate and Spring) and I can't figure why. My entities are Corpus and Semspace and there's a many-to-one relation from Semspace to Corpus as defined in my hibernate mapping configuration : <class name="xxx.entities.Semspace" table="Semspac...

Top tips for designing GUIs?

A while back I read (before I lost it) a great book called GUI Bloopers which was full of examples of bad GUI design but also full of useful tidbits like Don't call something a Dialog one minute and a Popup the next. What top tips would you give for designing/documenting a GUI? It would be particularly useful to hear about widgets you d...

How can I create a class file dynamically?

I want to create a class file dynamically. Here it goes... With the given ResultSet, extracting the metadata I want to build a class file dynamically with getter and setter methods for all the columns that exist in ResultSet. Also I should be able to use this class file generated where ever I want in my later use. Can any body suggest me...

Recommendations for Java + OpenPGP?

Hi! I want to develop a small OpenPGP client and I'm searching for a Java library for OpenPGP. Are there any (open source) recommendations for this approach? Cryptix.org does not seem alive anymore... Greetings, guerda ...

Java to C++ converter/tool

Hi I always asked myself if it would be possible to make a Java2C++ Converter. Maybe a Tool that converts the Java Syntax to the C++ Syntax.. i am aware that the languages differ .. but simple things like loops where the semantic matches 1 on 1 .. is there such a tool . or is it possible to make one ? ...

How to find true cause of com.sun.star.uno.RuntimeException?

I'm trying to replace a field in an OpenOffice document using the OpenOffice Java API. I'm using the insertString method: xText.insertString(((XTextField) fieldMaster).getAnchor(), value.toString(), false); The stacktrace is as follows: [junit] com.sun.star.uno.RuntimeException: [junit] at com.sun.star.lib.uno.environm...

Find out what JVM Eclipse is running on

I'm currently trying to tune my Eclipse installation and bumped into the "-vm" option. Other posts on SO mentioned that it's good to always use the latest JVM available because they keep getting better in terms of performance, so I'm likely to do that. I was wondering though how you could find out what JVM Eclipse runs on if you are not ...