java

How do I get a Raster from an Image in java?

I'm trying to load a gif image from a url into a java.util.image.Raster so I can manipulate it. The only method for loading and decompressing an image I could find was Toolkit.getImage, which returns a java.awt.Image. I need to turn that into a Raster so I can work with it. Suggestions? ...

RuntimeException: Could not start Selenium session: Internal Server Error

I am trying to detect a midair collision problem (simultaneous editin) using selenium. So I start a selenium session A with following (Super Class) selenium = new MASSelenium(serverHost, serverPort, *iexplore, browserURL); selenium.start(); selenium.open("index.cgi"); then I try starting a different selenium session B pointing to a d...

java/groovy socket write timeout

I have a simple badly behaved server (written in Groovy) ServerSocket ss = new ServerSocket(8889); Socket s = ss.accept() Thread.sleep(1000000) And a client who I want to have timeout (since the server is not consuming it's input) Socket s = new Socket("192.168.0.106", 8889) s.setSoTimeout(100); s.getOutputStream.write( new byte[100...

Different results from .mdb vs .odb, why?

I use the following query to retrieve data from a .mdb file through JDBC, however when I try it on an .odb file it goes does not throw any exceptions but there are no results at all. I am wondering is .odb case sensitive where .mdb is not or is there something else I am missing? "SELECT DISTINCT column-one + ':' + column-two As ResultCo...

What are some good Java tutorials?

Hello, I am looking for a good place to learn Java, or to download e-books regarding Java. Any help would be appreciated. Thanks. EDIT: I come from the C# world, so my main concern is learning how to use the Java / Swing API. My favorite format is a walkthrough-type tutorial where you learn by doing, not reading. ...

Oracle lag between commit and select

Hello, We have an Java workflow application that uses an Oracle database to track its steps and interactions with other services. During a workflow run several insert/update/selects are performed and occasionally the select will not return the updated data, even though the insert/update commit that ran before it completed successfully....

How can I add JMenuBars,JMenus and JMenuItems using IntelliJ's Swing GUI Designer?

I can't find the components specified in the title anywhere in IntelliJ's Palette. I notice that the form has a JMenuBar, but I don't see it, and I don't know how to access it. Is there any way of using these components visually? ...

Java Swing: Approach for dynamically appending text in text area, have scrollbar update

What is the general approach with Java swing to update a textarea with lines of text (say from a Thread) and then have the text caret flow to the bottom of the textarea as text is being added. Also update the scrollbar so that it is at the bottom. I was thinking that I would have a stringbuffer and append text to that and then set the ...

Store data with MIDP RMS and retrieve in PC.

How can I retrieve data stored using MIDP's RMS? I would like to collect some data in the handset and then be able to process it in the PC's application. If I can't do it using RMS, is there a way to store data in text files using MIDP? ...

Android (Java) Simple Send and recieve with Server - Fast Setup Challenge

Hi All, I'm writing an Android App and I'm looking for the fastest (In terms of setup) way for me to send data to a server and receive information back on request. We're talking basic stuff. I have a log file which tells me how a user is using my application (In beta, I wouldn't runin a user experience by constantly logging usually) an...

Why does JPasswordField.getPassword() create a String with the password in it?

Swing's JPasswordField has the getPassword() method that returns a char array. My understanding of this is that the array can be zeroed immediately after use so that you do not have sensitive things hanging around in memory for long. The old way to retrieve the password was to use getText(), which returns a String object, but it has been...

unmodifiablelist in .NET 4.0

From what I can tell, .NET 4.0 still lacks readonly lists. Can anyone shed light on why the framework still lacks this functionality? Isn't this one of the commonest pieces of functionality for domain drive design? One of the few advantages Java has over C# is this in the form of the Collections.unmodifiablelist(list) method, which it s...

Java JDBC Lazy-Loaded ResultSet

Is there a way to get a ResultSet you obtain from running a JDBC query to be lazily-loaded? I want each row to be loaded as I request it and not beforehand. ...

Dbunit ant task export: Exclude tables

Is it possible to say dbunit export all tables except the list (I'm using ant for the purpose)? ...

Ant copy file to leaf directory

I'm trying to use Apache Commons Configuration and using ant for my build tool. I have one namespaced class, and when ant builds it of course sub-directories. I need to put my .xml configuration file in the leaf directory (ie: ${build}/com/cross/xxx/). Is there an automated way to do this, or do I just manually configure the path of t...

Signed Java Applet writing to a text file

I want to make an Applet write to a text file. I think have overcome the security problem with my own certificate, but the text file isn't receiving the output. My Applet can be seen at tomrenn.com/fallball, and should ask if you trust the certificate. I'm not sure an Applet can write to a text file within the web hosted contents, so I...

How do I create a new Java project, without existing source files, with the ability to manually edit the Ant script using NetBeans

It seems like it's a fairly common thing to do. I want to create a new Java application that does not have any existing source files, but be able to edit the Ant scripts. ...

spring authentication provider VS authentication processing filter

both spring authentication provider and authentication processing filter also need to register with authenticationManager? authentication provider i can use custom-authentication-provider tag but what is different spring authentication provider and authentication processing filter ? ...

How to enable FINE logging for a single java class

I'm using java.util.logging.Logger logging in my program. How do I enable FINE logging for a single class, while setting it to WARNING for every other class? I'd prefer to do this programatically in my main() method rather than needing to set up additional properties files. ...

Partially load large text file with different encodings

I am writing a Java text component, and is trying to partially load some large text file in the middle (for speed reasons). My question is if the text is in some multi-bytes encoding format, like UTF8, Big5, GBK, etc. How can I align the bytes so that I can correctly decode the text? ...