Hi.
I am doing a method that needs to return a long[]. It looks like this:
public long[] parseString(String input)
input are strings like:
1, 3, 4
10, 30, 40, 50
Inside parseString I use a regex to get all numbers and add them to an ArrayList as I can't know how many oconcurrences it will find.
At the end I create a long[] with ...
I hava a table in ms sql2000 with a column defined as nvarchar
when query this table in java i get data for this column like this :
يا هلا بالشباب الØÙ„وين يا شباب ا٠شلونكو؟.
When i try php with adodb i get the data as it should be ,in arabic.
but i need to use java not php ,please can any one help m...
Hi all,
I have the following interface declaration:
public interface SomeInterface {
void someMethod() throws Exception;
}
I use a third party to generate an implementation of this class (JavaCC - for the curious)
The generated class looks naively like this:
public class SomeClass implements SomeInterface {
public void so...
hello, i am optimizing a jar with proguard, but it crashes after optimization.
here is my proguard task:
<proguard>
-injars ${dist}/${jarname}
-outjars ${dist}-proguard/${jarname}
-target 5
-libraryjars '${java.home}/lib/rt.jar'
-dontobfuscate
-optimizationpasses ...
Let's say I have the following model classes
package com.example.model;
public class Product {
private int productId;
private String productName;
//Getters and setters
}
package com.example.model;
public class ImageTypes {
private int imageTypeId;
private String imageLocation;
private String description;
...
What is your "favorite" API annoyance or missing feature or misengineered part?
...
What is the difference between
System.arraycopy(),
clone()
manual copying by iterating through the elements
and just doing arraynew = arrayold?
...
I have developed a number of classes which manipulate files in Java. I am working on a Linux box, and have been blissfully typing new File("path/to/some/file");. When it came time to commit I realised some of the other developers on the project are using Windows. I would now like to call a method which can take in a String of the form "/...
I will try and illustrate my question with examples, I am attempting to create a Java program that will (eventually) incorporate a complex Swing GUI.
I have Main.java
public class Main extends JFrame implements ActionListener {
JTextArea example;
public Main()
{
//... Missing, basic swing code
example = new J...
Hi,
I'm working with java, trying to use the AudioFormat Class. I have the following piece of code:
AudioFormat Baseformat = input.getFormat();
AudioFormat Finalformat = new AudioFormat(AudioFormat.Encoding.PCM_SIGNED,
Baseformat.getSampleRate(),
16, Baseformat.getChannels(), Baseformat.getChannels()*2,
Baseformat.getSampleRate(),fal...
I'm trying to learn how to develop a servlet to run under Apache's Tomcat server on Windows XP. I'm using Tomcat 6.0 with Java SDK 1.6.0_17. My webapp is a simple Hello, world type which I'm building using the latest version of the Eclipse IDE. I'm able to run all the examples in the Tomcat installation but when I export my app from Ecli...
Hello I would like to start developing a lifeRay theme and am a little bit lost!
I am a Mac user and i have installed liferay and also Xcode but i am not clear how to begin.
I have downloaded the SDK for liferay but i do not understand how to install it or use it for that matter, so questions:
Is Xcode an appropriate development envir...
Can I contain two different types in a collection? For example, can I have List< String U Integer > ?
...
For a university assignment in Java the specification requires that
Code Listings: in 10-point Courier New
typeface, and in Landscape mode if you
have lines that are too long to fit
into Portrait mode.
are included in the documentation. The term seem ambiguous to me and it's a bit late to consult my tutor, how would you defi...
I try to create the simplest Simplest WebServer and Client using HTTP. (Please, don't tell me to using Apache HTTPClient).
Client: try to PUT some file to Server.
// **PUT**
if(REQUEST.toUpperCase().equals("PUT")) {
File sourceFile = new File(fileName);
if(!sourceFile.canRead()) {
System.out.println("Have not access to this...
I understand that this may be impossible, but I would sure like to know if somebody has accomplished this, or have a work-around.
I have an SWT Button and am wanting to overwrite an existing JPanel's contents with just the Button being present. My current strategy is to have the SWT Button as an initial null field and then set it throug...
I am making a Java program, and one way to load files is to drag the file onto the application window (swing). I have code that works in Windows and Linux. It works in OS X, but the 1st file I drag throws an exception, and then the rest work fine.
Here is the code I use to enable DnD.
/*
* Allow a file to be opened by dragging it on...
Hello
I've got a window and I would like to get notified when the position or the size has changed. Which type of listener ist the best to take?
WindowListener didn't work for me...
Any way?
Thanks and regards
...
I was wondering what steps were needed to render Asian characters using the java based xhtmlrenderer (flying saucer) library?
I am wanting to render the following:
<html>
<body>同名の映画のモデ</body>
</html>
Without any font settings being added to the HTML this renders fine in normal browsers, but I can't find anyway to render this to ...
In c# you can setup properties like this:
public int CustomerId {get;set;}
Which sets up an automatic property called CustomerId, but I was wondering if there was anything similar in Java?
...