java

QCompleter and QLineEdit for multiple words

Hello, Is there any way to have the QCompleter to act like an autocomplete for multiple words? Someone has any ideia how to do it? Thanks ...

JUnit: Making sure failures in the test method are shown before failures in @After methods

I have designed a small test case class that is designed to make mocking easier (in this case, with JUnit 4 and EasyMock). Part of this is verifying the mocks after the test has finished, so the mocks are verified in a method annotated with @After. However, if there is a failure in the test method itself, which causes the test not to be...

Java - Differences in AWT from 1.4 to 1.5 ( working on Unix and Windows )

Hi, This is with reference to my question: java.awt.HeadlessException Applets not displayed. There is a next question that has come up from the Sys Admins. They are asking - "Why does java1.5 now requires the explicit export DISPLAY in tomcat at all when java1.4 did not?" So what has changed in java1.5 which is causing it to throw ...

JTree gives ArrayIndexOutOfBoundsException?

I try to dynamically add nodes to a Java Swing JTree, and the user should be able to browse and to collapse hierarchy while nodes are constantly added. When I add a Thread.sleep(10) in my loop, it works fine; but this is a dirty hack... Here is the stripped down code that triggers this problem. Whenever I run this and doubleclick on the...

Exporting a GUI to xml?

Is there a tool to take a GUI designed in C# or other languages that can take the screen layout and export that to an XML file such that you end up with a template of the screen in xml terms? As well as take an xml file and display the resulting screen? ...

Comparing text files w/ Junit

I am comparing text files in junit using: public static void assertReaders(BufferedReader expected, BufferedReader actual) throws IOException { String line; while ((line = expected.readLine()) != null) { assertEquals(line, actual.readLine()); } assertNull("Actual had more lines then the expected.", ac...

What is the standard way to handle url-mapping for JavaServer Faces?

All the tutorials I have seen seem to use *.jsf, *.faces, or /<directory_name>/* for the url-pattern in the Java Server faces servlet mapping. Is there some official sun-recommended naming convention or de-facto standard? ...

Can you get basic GC stats in Java?

I would like to have some long-running server applications periodically output general GC performance numbers in Java, something like the GC equivalent of Runtime.freeMemory(), etc. Something like number of cycles done, average time, etc. We have systems running on customer machines where there is a suspicion that misconfigured memory ...

Set working directory in <junit> Ant task

Hi, My Ant build includes a junit task that runs some tests. In order for the tests to work, the value of the property that specifies the current working directory (user.dir) must be changed, but I am unsure how to achieve this. The task in question currently looks like this: <junit printsummary="withOutAndErr" fork="true" haltonfailu...

JPA GUI tools

Hi, What are the GUI tools available for JPA? ...

Renaming Threads in Java

I am working on a project that is slowly getting larger and larger and the number of active threads used by many different processes is increasing. Lately, I have been taking a closer look at the running threads in the debugger and I have noticed that a lot of my third party libraries have given very poor names to their threads - Timer-0...

Java: Knuth shuffle on a Stack?

Hi, For a programming class I am creating a blackjack program for the first homework assignment. The professor has given us a sample Card class, which includes the method to add them to a deck. For her deck, she uses an ArrayList, which you can easily Knuth Shuffle with the Collections.shuffle() method. That method does not work for St...

JPA/Hibernate maximum number of joins?

Is there a limit to the number of joins permitted in a JPA/Hibernate query? Since Hibernate doesn't automatically join, I have to explicitly specify the joins in my JPA/Hibernate query. For example, person has an address, an address has a state. The following query retrieves person(s) with address and state fully loaded: select p, a, s...

Link reports to Java? or Find means to apply BOLD format within Paradox 4.5?

I need to read reports in Java from Paradox but I don't know how to do this. Can reports be imported through netbeans using a working driver? I have linked tables to Java but not the reports. I need to apply some Rich Text (ie. making a sentence BOLD - thus the need for the connection). Do you have any suggestions as to how I can pri...

Hibernate equivalent to EclipseLink's batch query hint?

One thing I like about EclipseLink has this great thing called the batch query hint, which I'm yet to find a Hibernate equivalent of. Basically doing a whole bunch of joins gets messy real quick and you end up querying way more data than you necessarily want (remember that if you join person to 6 addresses the person information is retu...

Can I execute a shell script from a web page?

My web page uploads a file. Currently it places that file in a directory which is polled by a cron job. If the file is there, a bash script acts on the file. I hate the fact that I am polling. The upload happens perhaps once a week, but the user wants to see results within minutes from their file, so I end up polling every 5 minutes....

Oracle's ADF-Faces better than generic JSF? ...smells funny to me.

My developers would like to use Oracle's ADF-Faces rather than generic JSF. The advantages of "drag and drop" programming smells funny to me. Reminds me too much of the 4GL application environments of the early 90's that collapsed when you tried to extend outside of the box that they had drawn around you. Great productivity inside the...

Pure lightweight application in java

Is it possible to write "pure" lightweight code in java? Swing is lightweight but even it has heavyweight components like JWindow, JFrame, JDialog, and JApplet. So even Swing applications are not 100 percent independent of the underlying OS Is it possible to have lightweight applications in java which are completely independent of the u...

Streaming files over the network with random access - java

Hey all, So ive got a need to play music files from a server on the network, in a java client app. I was thinking Sockets - have the server open a music file as a stream, and have the client connect to that and read & play it as an InputStream. Which would work - except AFAICS users wont be able to seek into the file(which they can curr...

Which language/platform to develop desktop application based on following criteria

Hi, Faced with the challenge of a new application with which you had free reign to design, assemble a team to develop and manage: Which language/platform would you choose? Why? Background: The desktop application will control a hardware device and perform computations, analyze and display the data returned by it. Requirements: (i...