java

why isn't my Jlabels or Jpanels showing??

i've added a title to my Jframe, and now its blocked everything else, what have I done?? public class addressbook { public JFrame frame; public JButton btnadd, btndelete, btnsave, btnprev, btnnext; public JPanel panel, pTitle; public JTextField txtname, txtaddress, txthomeno, txtmobno; public JLabel JlbName , JlbHtn, JlbMtn, JlbAddress,...

java dynamic classloader

hi how can I dynamically load a class in Java with two parameters which are the absolute filepath of the class file and the name of the method I wish to call? eg path: c:\foo.class method: print() I am just interested in the basics as a simple cmd line tool. A code example would b appreciated. cheers hoax ...

Median of Medians in Java

I am trying to implement Median of Medians in Java for a method like this: Select(Comparable[] list, int pos, int colSize, int colMed) list is a list of values of which to find a specified position pos is the specified position colSize is the size of the columns that I create in the first stage colMed is the position in those columns...

Are my assumptions about configuration correct?

I want to use to implement only REST service - a very simple one returning 'person' by full name or id in JSON. Im probably will be using JAX-RS and maybe JAXB - im not sure if tis is a right choise. I want to use it with following technologies/products and their versions: JDK 1.5 Eclipse 3.5 EE Tomcat 6.0 CXF 2.2.5 Spring 2.5.1 My q...

Connect to site through https

I have some application that should connect to https Site, and receive some. With connection all is ok, but when i what getInputStream() comes Exception: java.io.IOException: Server returned HTTP response code: 403 for URL: Here is the part of code: String query = siteURL.toExternalForm(); URL queryURL = new URL(query); String...

JSF/SEAM: How to pre-select checkboxes in a form

Hi, I have a form where i have to preselect some checkboxes. How is that possible with jsf/seam? In plain html you would just add the "checked" (or checked="checked") as attribute to the checkboxes. But with f:selectItems I have no clue...also the Object "SelectItem" does not provide any setter for this... ...

War deployment on Tomcat takes ages

I have a Grails application, built to a war file (~30mb). When I attempt to deploy the war file on Tomcat 6 via the application manager, it takes upwards of 10 minutes to deploy, or hangs indefinitely. When it hangs I can restart Tomcat and the app is usually deployed, however sometimes I have to repeat the process. I've also noticed tha...

Ways to prevent broken pipe?

ClientAbortException: java.net.SocketException: Broken pipe If I am wright, this happens when user aborts current operation or makes another request, before the last one is finished. Can this reflects on browsing user or is this (always) just a Catalinas exception? Are there any ways to avoid this exception? ...

Render html in Swing application

I have a swing application that sends commands to server and receives result in XML format. I need to transform this into HTML via XSLT and then display result HTML on the panel. The problem is that the only Swing component which is able to display HTML - JEditorPane - takes either URL or javax.swing.text.StyledDocument as a source. Opt...

Satchmo like project in Java.

Is there a satchmo like project in Java? EDIT As for those trying to close the question, I did as requested and asked on server fault where it was not well received. ...

Understanding trees in ANTLR

I'm trying to use Antlr for some text IDE-like functions -- specifically parsing a file to identify the points for code folding, and for applying syntax highlighting. First question - is Antlr suitable for this requirement, or is it overkill? This could be achieved using regex and/or a hand-rolled parser ... but it seems that Antlr is ...

Determining visible area from globe frustum

I'm working with a mapping application (worldwind) and trying to determine the minimum and maximum latitudes and longitudes that are currently displayed. I have access to the frustum, but I'm not sure how to account for the fact that the globe can have its heading and/or pitch changed. Any help on this problem would be appreciated. than...

Stored proc running 30% slower through Java versus running directly on database

Hi All, I'm using Java 1.6, JTDS 1.2.2 (also just tried 1.2.4 to no avail) and SQL Server 2005 to create a CallableStatement to run a stored procedure (with no parameters). I am seeing the Java wrapper running the same stored procedure 30% slower than using SQL Server Management Studio. I've run the MS SQL profiler and there is little...

Super constructor call in Blackberry Screen classes.

Why is the super() constructor recommended to be called when extending any of the RIM Screen classes? It was my understanding that the no-arg constructor of any super class was implicitly called from any class that extends it, am I wrong? ...

Why does this use of Java Generics not compile?

For the life of me I cannot understand why the compiler won't let me do the following... import java.util.HashMap; import java.util.Map; public class TestMap { private final Map<Integer, ? extends Number> map = new HashMap<Integer, Number>(); public void put(Integer key, Long item) { this.map.put(key, item); } } Why d...

Java seems to be truncating long string result from MS-SQL query

So I've got a query in a JSP class that retrieves, basically, the entire contents of a table as a string using MS SQL's "FOR XML AUTO" feature. I.e., select * from userdata for xml auto. The problem is that the result is being truncated at around 2033 characters. There's no unusual character at that point or anything; the break occurs...

Exporting EAR file in Eclipse taking long time

I'm working on a project on Eclipse, more specific RAD build. The EAR file exported is around 40 mb, last week it was taking 1 minute, today its taking more than 10 minutes. I didnt change much code, nor changed any config related to the JVM. I export directly from RAD, right click on the project and export EAR. So whats going wrong? ...

reading from XMl file in java

I have a simple XML file <requirements> <requirement> <name> SwitchON</name> <id>1</id> <text>The Light shall turn on when the Switch is on.</text> </requirement> <requirement> <name>SwitchOFF</name> <id>2</id> <text>The Light shall turn off when the Switch is off.</text> ...

java - nullpointer exception

Guys i need some help here , im getting this error here at the code snippet below. here's the stack trace. i have a feeling that somebody's gonna say not much effort on my part. its ok i agree , give me a suggestion what should i do more and ill do it just that i've got a little stuck and not moving ahead so thought of posting it here....

Deprecate in Java 1.6

In Java 1.5, to deprecate a method you would: @Deprecated int foo(int bar) { } Compiling this in Java 1.6 results in the following: Syntax error, annotations are only available if source level is 1.5 Any ideas? ...