For some caching I'm thinking of doing for an upcoming project, I've been thinking about Java serialization. Namely, should it be used?
Now I've previously written custom serialization and deserialization (Externalizable) for various reasons in years past. These days interoperability has become even more of an issue and I can foresee ...
Comment une image devient un noeud dans la palette et on peut l'inserer dans la zone de dessin
translation:
How a picture becomes a node in the palette and can be inserted in the drawing area
...
Where do you seen using Scala for your project?
...
I try to open a large number of files but after 5000 files or so I get
Exception in thread "Main" java.io.IOException: The device is not connected
Is this the expected behavior? Is there a way around it? I want to leave my code as straightforward as possible.
...
Is there a Java Application Architecture Guide that is a counterpart of this: http://www.codeplex.com/AppArchGuide ?
...
Hi everyone,
I am creating a windows service in Java that writes data to an object.
This object has to be accessible by another Java program.
What is the best approach to take?
Thank you.
Jack
...
In application frameworks I keep seeing frameworks that allow you to pass in multiple Int values (generally used in place of an enum) into a function.
For example:
public class Example
{
public class Values
{
public static final int ONE = 0x7f020000;
public static final int TWO = 0x7f020001;
public sta...
I'm using JLayer to play an inputstream of mp3 data from the internet. How do i change the volume of the output?
I'm using this code to play it:
URL u = new URL(s);
URLConnection conn = u.openConnection();
conn.setConnectTimeout(Searcher.timeoutms);
conn.setReadTimeout(Searcher.timeoutms);
bitstream = new Bitstream(conn.getInputSt...
Can someone please explain what this means?
Enum<T extends Enum<T>>
This seems like a circular definition, and I find it highly confusing to say the least.
...
Hi All
I have two XML files of similar structure which I wish to merge into one file.
Currently I am using EL4J XML Merge which I came across in this tutorial.
However it does not merge as I expect it to for instances the main problem is its not merging the from both files into one element aka one that contains 1, 2, 3 and 4.
Instea...
Fixed the problem with the following code - not the most gracious way - but i need a quick solution for this assignment
package six.desktop.gui.common;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URL;
public class Config
{
private static final String configFileName =...
I want a thread to execute in the background every 500 milliseconds. To do that, I extended a Thread, implemented ActionListener and put the class that I extended into a Timer. The Timer calls run() every 500 milliseconds. However, my whole Swing GUI freezes up when this thread is downloading stuff from the Internet. I want it to run in ...
I have a JTree implementation for directories in the file system. The problem I have is that when a directory is removed or renamed, the tree still shows the directory in it's parent. The parent tree seems not to be updated for any changes once a node has been expanded.
The model I have written does not cache (I have commented out what...
I'm working on a project fuzzing a media player. I wrote the file generator in Java and converted the CRC generator from the original compression code written in C. I can write data fine with DataOutputStream, but I can't figure out how to send the data as an unsigned character array in java. In C this is a very straightforward proces...
I am practicing for an exam, and found a sample problem that gets me totally lost.
For the following code, find what the output is:
class Moe {
public void print(Moe p) {
System.out.println("Moe 1\n");
}
}
class Larry extends Moe {
public void print(Moe p) {
System.out.println("Larry 1\n");
}
public v...
I need to write a program in Java to generate random numbers within the range [0,1] using the formula:
Xi = (aXi-1 + b) mod m
assuming any fixed int values of a, b & m and X0 = 0.5 (ie i=0)
How do I go about doing this?
i tried doing this but it's obviously wrong:
int a = 25173, b = 13849, m = 32768;
double X_[i];
for (int i = ...
I have a WSDL file for a web service. I'm using JAX-WS/wsimport to generate a client interface to the web service. I don't know ahead of time the host that the web service will be running on, and I can almost guarantee it won't be http://localhost:8080. How to I specify the host URL at runtime, e.g. from a command-line argument?
The ge...
How can I get an InputStream from a BufferedImage object? I tried this but ImageIO.createImageInputStream() always returns NULL
BufferedImage bigImage = GraphicsUtilities.createThumbnail(ImageIO.read(file), 300);
ImageInputStream bigInputStream = ImageIO.createImageInputStream(bigImage);
The image thumbnail is being correctly generate...
I am trying to send xml to a java-based web service given to me by a thrid party via a c#.NET application, and I get the "org.xml.sax.SAXParseException: Content is not allowed in prolog" error.
I have verified the xml against the schema, and I passed the memorystream I am using to hold the xml to an .xml file, then opened the file with...
Hey all,
I am trying to wrap my jar as an exe using launch4j. However I am using the lwjgl library and having trouble linking the native dll's. My directory structure is as follows:
I have a top directory which contains the following path: top/lib/lwjgl/native/win32 where my lwjgl dll's are contained.
There is also a dist directory th...