Does Java have any functionality to generate random characters or strings? Or must one simply pick a random integer and convert that integer's ascii code to a character?
There are several tools to build java projects:
ant
mvn
ivy
buildr
...
From my experience Ant is great for small projects and projects with special build requirements.
Mvn is great for large but typical projects without too much special requirements. It also seams better for open source than for commercial projects.
What would you recommend in case of large, enterprise, commercial projects ?
What do you currently use and what would you rather use and why ?
Hi,
What is the need of Collection framework in Java since all the data operations(sorting/adding/deleting) are possible with Arrays and moreover array is suitable for memory consumption and performance is also better compared with Collections.
Can anyone point me a real time data oriented example which shows the difference in both(array/Collections) of these implementations.
Thx
E.g.
input: ['A', 'Z', 'F', 'D', ...]
output: [0, 25, 5, 3, ...]
In C I'd just subtract the char from 'A', but I don't seem to be able to do this in java.
I'm creating an XML document. I got it to indent using TransformerFactory.setAttribute("indent-number", new Integer(2));
Transformer.setOutputProperty(OutputKeys.INDENT, "yes");
Is it possible to get Java to use tabs instead of spaces for indenting? And how?
Please tell me how to write wsdl file of service developed in java. For example:
package fromjava.server;
import javax.jws.WebService;
import javax.jws.WebMethod;
@WebService
public class AddNumbersImpl {
@WebMethod(action="addnumbers")
public int addNumbers(int number1, int number2) {
return (number1+number2);
}
}
this is a web service....so what will be the corresponding wsdl file? if u guys have any tutorial then please help me out.
I am looking for something like a portal, or a community where everybody posts their contributions in Java.
Ex. polynomial calculations, ...
Scenario: Search - "polynomial" - download package (source code)
Thank you.
I'd like to see how the code is organized and how the various GUI design patterns are applied. Anything Java and in desktop gui style is fine: GWT, Swing, SWT. Thanks.
I am using a ServerSocket port to run one instance only of my Java Swing application, so if a user tries to open another instance of the program, i show him a warning that "Another instance is already open". This works fine, but instead of showing this message i want to set focus on the running application itself, like some programs does (MSN Messenger), even if it was minimized.
Is there a solution for this for various operating systems ?
Say suppose i am running a java program through command line. and this program requires some data to enter during the execution. So i was wondering on what happens if somebody uses javaw to run this type of program? that is how can enter the data to the program.
I'm creating a tree of folders and files in java. Windows and OSX return the system icons and name with the following code:
new JFileChooser().getIcon(File f);
new JFileChooser().getName(File f);
Is there any possibility to get the icons and name of unix systems?. A system command would be ok too.
Thanks.
I am trying to re-arrange all the attributes of the XML file.
Need to group all the attributes of each node.
Here is the required output XML file:
Can this be possible with XML DOM in JAVA?
What's the quickest way to remove an element from a Map by value in Java?
Currently I'm using:
DomainObj valueToRemove = new DomainObj();
String removalKey = null;
for (Map.Entry<String, DomainObj> entry : map.entrySet()) {
if (valueToRemove.equals(entry.getValue())) {
removalKey = entry.getKey();
break;
}
}
if (removalKey != null) {
map.remove(removalKey);
}
Is there any way in Java to enforce a minimum window size?
The last article I can find is from 1999, and has some complicated code to mimic the behaviour...
http://www.javaworld.com/javaworld/javaqa/1999-10/03-qa-window.html
Surely there is a simple method that can be used?
I have a textfile which my Java program is modifying and putting into an HTML file for display.
However, this textfile contains lots of HTML unsafe characters such as "<" and the "" which would need to be encoded into & gt; (sans space) and & lt;.
Is there some library method I can use to sanatize my text document to replace all these HTML special characters with their safe encoded equivelants?
What is the best way to do a resizable array in Java? I tried using Vector, but that shifts all elements over by when when you do an insert, and I need an array that can grow but the elements stay in place. I'm sure there's a simple answer for this, but I still not quite sure.
I'm looking for a good general library to grab localized labels for displaying on a web page. I've found some useful solutions at http://stackoverflow.com/questions/19295/database-backed-i18n-for-java-web-app and I will use them but I wanted to see if there was a standard library other than the fmt jstl tags that is already database backed.
I am just wondering if it's possible to I cancel "Drag and Drop" operation in Java/Swing programmatically? So the effect would be similar to if the user pressed the "ESC" key?
I was expecting DragSourceDragEvent or DragSourceContext to have a cancelDrag() method, similar to DropTargetDragEvent which has acceptDrag() and rejectDrag() methods (both of which does not do what I want).
I am missing something?
Hiya.
I need to create a dynamic array in Java, but the values type differ from String to Int to float. how can I create a dynamic list that I don't need to give it in advanced the type of the values?
The keys just need to be ascending numbers (1,2,3,4 or 0,1,2,3,4)
I checked ArrayList but it seems that I have to give it a fixed type for the values.
thanks!
I have an application written in Java to run on Linux. I'm developing in Eclipse under windows. I would like to run the code on the Linux box and debug it on the Windows one remotely. I've found some information about how to do so, but it's pretty sparse. Does anyone have (or can point to) a complete explanation of the process?
Any help would be appreciated.
While developing GUI using Java ME- I get the wordwrap for the text being shown on ChoiceGroup, but the text on the ChoiceElement doesn't get shifted to the new line if the length of the text exceeds the size of screen. How can we get the wordwrap for the text being shown on the ChoiceElement?