java

What are some large, model-rich open source applications?

I need to identify a large model-rich open source ruby, c-sharp, objective-j or java applications so that I can target them for a series of projects. Are you guys aware of any that I could use? ...

Best way to parse an XML String in Java?

I am parsing a string in Java using javax.xml.parsers.DocumentBuilder. However, there is not a function to parse a String directly, so I am instead doing this: static public Document parseText(String zText) { try { DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance(); DocumentBuilder dBuilder = dbFactory.newDocu...

How do I fire an action when the user leaves a JTextBox?

I've got a JTextField, and I'd like the system to do some processing on what the user typed whenever the user leaves the text field. The ActionListener that you can add to just the JTextField only fires when the user presses enter, however. I'd like the processing routine to run whenever the user leaves the text box by any means - tabs,...

Java marketshare: what version of Java runtime do most people have? Do I need to use Flash to get 90% possible marketshare?

My friend and I are planning to build a simple chat client to let people in a (physical, real world) room chat with each other (people chatting over the same wifi network, possibly pinging some external server to organize things by the external IP address of the wifi network). Partly we planned this as a chance to play around with Groovy...

Is there a case for conducting unit tests (and integration or regression if applicable) with Groovy?

Is it just hype about testing Java classes with Groovy rather than using Mockito, Easymock etc? What's your experience and ease of application? ...

How to find static method calls in large Java project?

I'm refactoring some Java code to be more decoupled by changing some static method calls to non-static calls, for example: // Before: DAO.doSomething(dataSource, arg1, ..., argN) // After: dao.doSomething(arg1, ..., argN) My problem is that in a large project, it can be hard to find where static method calls are being made. Is there ...

java.lang.OutOfMemoryError: Java heap space

while using Jruby, i get this message. Complete Java stackTrace java.lang.OutOfMemoryError: Java heap space how to resolve ? ...

How to find all available maze paths?

I am trying to write a program that is given a maze and tries to find the way out. M is the entrance, E is the exit, 1s are walls, and 0s are pathways. It is supposed to find each path and put P in the path. It is supposed to find all available paths. Right now it finds part of a path. Here is the code: public class Maze { private...

Debugging JSR 168 portlets.

I would like to ask people their testing strategies for portlet controllers, particularly spring portlet mvc based portlet controllers. Do you use the eclipse debugging function? What kind of portlet container set up do you have in your development environment? ...

Converting XML input from multiple lines to one line

I have an xml like this <address> <street>abc</street> <number>123</number> </address> <address> <street>abc1</street> <number>345</number> </address> ... ... <address> <street>xyz</street> <number>999</number> </address> I want to be able to convert this to <address><street>abc</street><number>123</number></addr...

how to validate first the 2 file name, before comparing the content?

this code is used to compare the content of 2 text files, but i need to validate first, that the names of those 2 file is not same. can you help me to fix this code? import java.io.*; import java.util.*; public class compare { public static void main(String args[]) throws IOException { try{ FileInputStream file1...

How do I add spell checking to a JTextArea?

I have a small Java application that has a JTextArea where the user enters text. I would like to add spell checking capabilities to this component similar to the way that Microsoft Word does it, i.e. misspelled words are underlined and a popup menu with corrections is displayed when the user right clicks on the underlined word. Are there...

Advice needed: stay with Java team or move to C++ team?

Some background - I have been programming in Java as a professional for the last few years. This is mainly using Java SE. I have also touched bits and pieces of other various Java technologies and have some basic knowledge about them. I consider my self as an intermediate Java programmer. I like Java very much. I think it is only go...

GWT printing to PDF

Hi guys, I wanna to a pop over content to PDF. I am using GWT. I think client side its impossible. But any budy here know how browser can print into PDF file? And is there any way to print a HTML content into PDF on server side? I have a HTML content with CSS on adding this content to PDF the view should remain same as it appear in HTML...

Any idea how to use Jmeter for performance testing of Standalone Java app???

Any idea how to use Jmeter for performance testing of Standalone Java app??? thanks ...

ServiceTracker sometimes misses services?

I have an OSGi service tracker with a filter. I noticed that there's a service that it misses ('addingService' is not called). When I use the services command in my osgi (equinox) shell, with the filter that the tracker uses, the missed service is returned. ...

Yahoo messenger API for Java

I want to connect to Yahoo messenger through a Java API. I'm using the jYMSG API, but now I'm not able to connect to Yahoo messenger as I'm getting the error "Use updated version". I'm using the jYMSG 6 API. What should I do? ...

JNDI lookup of EJB3 inside an EAR file on Glassfish

I have an EAR file with a bunch of JARs in it, and one of these JARs contains Local Session Beans (EJB3). I need to perform a JNDI lookup of these Session Beans from within an unmanaged POJO, also contained in the EAR (and in this case in the same JAR as the EJBs as well). I tried following the Glassfish EJB FAQ, but I keep on receiving ...

scope of a controller and a validator

We are developing an application using Spring MVC. There is a page which displays list of user, a check box next to it, and a submit button at the bottom of the page. A logged in user can select those check boxes and submit, currently a controller checks whether the selected user list is empty or not and acts accordingly. Should we just...

Socket connection with coldfusion

I tried the below function.This function allows ColdFusion developers to connect to remote hosts through the TCP/IP protocol and transmit messages. Very useful for implementing chat rooms, integrate with third party applications such as merchant carts etc. <cffunction name="easySocket" access="private" returntype="any" hint="Uses Java S...