I have a Swing application, and even though I have everything in a try/block, the exception isn't caught.
public static void main(String[] args) {
try {
App app = new App();
app.setVisible(true);
} catch (Throwable e) {
System.err.println("never printed");
}
}
all I get is this stack trace:
Exception in threa...
Can someone recommend a good statistics library for Java - it must include the ability to calculate the correlation of two data sets.
I have been trying to compute the correlation of two ArrayLists - for some reason I am getting an incorrect answer (checked in Excel) despite what seems to be sound logic.
I found one at jfree.org which ...
I'm getting a slight distortion (sounds like buzzing) in the background when I run the following code. Because of its subtle nature it makes believe there is some sort of aliasing going on with the byte casting.
AudioFormat = PCM_SIGNED 44100.0 Hz, 16 bit, stereo, 4 bytes/frame, big-endian
Note: code assumes (for now) that the data is ...
With some changes in the staffing at the office, the levels of C# expertise has dropped off precipitously and there are now more Java developers. It has gotten to the point where the higher-ups are considering moving an existing .NET project written in C# into the Java world.
Aside from the obvious problem of starting completely from s...
Hi, I was wondering if there's a language feature in Java in which methods of a superclass would be invisible for members of a subclass:
public class Subclass extends protected Superclass
or something. I'll give an example.
Here is your superclass.
public class A{
public String getA(){...}
public String getB(){...}
publ...
Some amendment of the data in txt file.
I have tried the suggested code but Im not successfully write it again in the txt file with this format.I've tried the collection.sort but it write the data in long line.
My txt file contain these data:
Monday
Jessica Run 20mins
Alba Walk 20mins
Amy Jogging 40mins
Bobby Run...
Item is a simple model class.
ItemComponent is a view for an Item which just draws simple rectangles in a given spot. A bunch of ItemComponent instances are put into a parent component that is added to the JFrame of the application (just a simple shell right now).
The view has two different display styles. I want to adjust some proper...
I'm trying to local a properties file programmatically without having
to pass it's fullpathname on the commandline to my program. I figure if I can
locate the path of the main class, I can stick my properties file in the same
directory or a sub-directory.
If that won't work is there some other way I can locate the path of a properti...
Anyone know what is wrong?
See the Eclipse error log for more details
!STACK 0
com.google.appengine.tools.admin.AdminException: Unable to upload app: Error posting to URL: http://appengine.google.com/api/appversion/create?app_id=guest-book&version=1&
400 Bad Request
Invalid runtime specified.
at com.google.appengine.tools.admin...
What differences will Java 7 have from Java 6, and what will it mean to us Java programmers?
I'm very curious about what the future of java holds, and I've been able to find some info on Java 7, but I want to know what all that info really means. Like what will a modular JDK do for programs?
See also: What are you looking forward to i...
Time ago I read about Java 3D integration into Java FX, the article reported the main Java 3D project as "dead" for rewriting the 3D engine into FX.
...
I have class with a forwarding method foo:
void foo( Concrete c, String s ) { c.bar( s ); }
I wish to test that foo in fact forwards. Unfortunately for me, Concrete is a class in a third-party library, and is a Concrete type, not an interface. Thus I must use ClassImposterizer in Jmock to mock Concrete, so in my testcase I do this:
@...
I want to store sockets in my database and retrieve them also. But sockets are not serializable so I was unable to do this.
How can I store sockets in a database?
...
How can OC4J be configured to support Arabic?
some arabic contents appear as ? question marks, however in the pages that this probelm arises in it, the page encoding (<%@ page pageEncoding="windows-1256" %>) is set properly (I tried all possible alternative windows-1256, utf8, ... etc)
...
I am not sure if I am getting in a little too deep but I have decided i'd like to learn how to develop applications built using the Oracle technology stack.
I don't come from a programming background (I have always been on the business side) but I love that no matter what problem you encounter, you can almost always solve it with a prog...
I have a number of CSV files that I want to download from Yahoo finance each day. I want my application to read the file's creation date (on my computer, not the server). If the creation date is prior to today then the new file should be downloaded (as it will have new data). If not then the new file should not be downloaded, and the cor...
Hi,
I've created a class which holds a bunch of properties values.
In order to initialize that class, I have to call some static method "configure()" which configures it from an XML file.
That class was supposed to act to store some data such that I could just write
PropClass.GetMyProperty();
I call the configure() from a static b...
I know this is gonna be a stupid question.
Pardon me as a n00b into CS
I have a new swing component that inherits from JComponent.
I am trying to paint lines on its surface to show that the lines split the control into equal parts. The code looks like
int spc;
spc = (int) Math.round((this.ZBar.getWidth() / this.ZBar.getModel().getModel...
I'm trying to write a simple server-client program, but I have a problem:
I can send data from client to server, but I can't send data from the server (I can't recive it in the client) :(
So how to send data from the server, and recive it in the client?
Server:
//this is in a thread
try {
server = new ServerSocket(1365);
} catch (I...
I realize there are similar questions on SO, but they don't quite solve my problem.
I would like a method that, given a Class object, will invoke the "main" method, that is to say, public static void main, on that Class (if it exists) and capture the console output of that main method. The class doing the invocation is a non-daemon thr...