Hi
Sorry for the newbie question, I'm used to C# so my Java framework knowledge is not so good.
I have a couple of arrays:
int[] numbers = new int[10];
String[] names = new String[10];
//populate the arrays
Now I want to make a generic function which will print out the values in these arrays, something like the following (this shou...
I'm creating a web service in Java that will be consumed by an external application, probably written in C#. In my Purchase bean, I have a Currency object for the total cost. However, this leads to the following error:
Caused by: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions
java.util...
I'm playing with things I don't really understand at the moment for a JAVA project on a Robot exploring an unknown territory (a grid of valid positions and blocked positions). Anyway, I tried to improve the basic GUI we were given as an example of how to proceed, it had been done with a text field and various unicode characters to repres...
I have been trying to determine the type of a field in a class. I've seen all the introspection methods but haven't quite figured out how to do it. This is going to be used to generate xml/json from a java class. I've looked at a number of the questions here but haven't found exactly what I need.
Example:
class Person {
public fina...
The real question here might be if there's a better way to display desktop messages in Java. However...
I'm using the Java trayicon to display messages to a desktop user. Because they want to keep certain messages up until the user clicks on them, in order to use the 'displayMessage' feature, I have to keep displaying them until the u...
Hi All,
I have a maven module that uses the plugin jaxws-maven-plugin. I have the webservice up and running and when browsing to the .../myWebservice?wsdl, I get the WSDL. No problem.
This also works when running the wsimport maven goal through:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxws-maven-plugin</artifa...
What are the recommended approaches to using Thread.sleep() to speed up tests.
I am testing a network library with a retry functionality when connections are dropped or timeout errors occur, etc. The library however, uses a Thread.sleep() between the retries (so it won't connect thousands times while the server is restarting). The cal...
I get this error when deploying the ear file on to WLS 10.3 on AIX platform. (The same ear works fine on Windows / Linux platforms)
Caused by: java.lang.ClassCastException: org.apache.xerces.parsers.XIncludeAwareParserConfiguration incompatible with org.apache.xerces.xni.parser.XMLParserConfiguration
at org.apache.xerces.parsers.DOM...
Spring Version: 2.5.6
I want to resolve the view to a specific velocity file based on the value of the User-Agent header.
My current line of thinking is an implementation similar to the UrlBasedViewResolver such that the user-agent value is Map'd (via context) to a specific directory(value) based on a matching a regular expression(key)...
Is it possible to draw diagonal lines over a JTextField (or any other Swing control as well) without just putting a panel over the textbox?
...
I'm having difficulty using an inner Iterator.
private List<List<? extends HasWord>> sentences = new ArrayList<List<? extends HasWord>>();
private Iterator<String> wordIterator = new Words();
private class Words implements Iterator<String> {
int currSentence = 0;
int currWord = 0;
@Override
public boolean hasNext() {
return cur...
I'm looking for a PriorityQueue implementation which is also a Set.
The compareTo implementation if its elements must not have the requirement to be consistent with the implementation of equals.
Is there somewhere such a implementation for java?
Update: I implemented it now using a SortedSet as the internal collection. So I only had t...
Hi!
what are the possible return types for a web service? I am using NetBeans 6.7.1 and working in Java.
I want to make a web service that would return String[]... I made a class of Authorization and I want to add a function in an already made web service. the problem is that it doesnt let me make an operation of return type string.
Any...
There are few servers runing simple MBean server listening on specified port.
These servers are supposed to be monitored by main server running glassfish with an application based on EJB 3.
One of the sessionbeans should perform monitoting by connecting to remote MBean.
I use this url service:jmx:rmi:///jndi/rmi://${host}:${port}/jmxr...
Ok, so a user enters some information on a JSP and clicks 'submit' which launches a servlet. This servlet then processes the information and sends back another JSP. That works fine.
However, what about if the servlet needs to ask the user a question before continuing the processing? In a general Java Application you can use the likes of...
How can I add WCF Service Reference to my Java Console Application ? I want to use this method for prove the interoperability of my wcf Service.
...
Hello,
I'm working on my first GWT-based Java project for a school assignment. It's a chat application and the client polls the server for new events, while the server keeps an timer for each user to detect inactivity.
The following problem occurs at runtime:
Dec 8, 2009 7:41:17 PM com.google.apphosting.utils.jetty.JettyLogger warn
WA...
I already wrote something that removes the first character of a string and puts it after the remaining substring and then prints it out, the instructions were to reverse the sentence using recursion by removing the first letter of the sentence and concatenate it to the reversed remaining substring, ie. "Hello" yields "olleH". But i dont ...
Is there a method for changing the LSB value of java.awt.Color RGB components?
...
Hi,
I am using GlazedList's autoComplete support in a JTable using the below code
itemColumn.setCellEditor(AutoCompleteSupport.createTableCellEditor(itemList));
How do I prevent the selection or editing the next cell, if the user hasn't selected any value in the CellEditor.
...