I wanted to know if there is any standard APIs in Java to validate a given URL?
I want to check both if the URL string is right i.e. the given protocol is valid and then to check if a connection can be established.
I tried using HttpURLConnection, providing the URL and connecting to it. The first part of my requirement seems to be fulf...
How can I access a simple java object as a bean?
For example:
class Simple {
private String foo;
String getFoo() {
return foo;
}
private void setFoo( String foo ) {
this.foo = foo;
}
}
Now I want to use this object like this:
Simple simple = new Simple();
simple.setFoo( "hello" );
checkSettings( ...
Possibly an odd question but how can I change how my Java Swing combo box displays its list of items? The default behavior is for the list to be displayed below the combo box. There are times, when the combo box is low on the screen, that the list is displayed above the combo box. Is there a way to force it to always display above? W...
Hi to all!
I have the following situation...
I use CallableStatement from java.sql package. When I use setDate function prior to executing stored procedure, I get an error:
Cannot find symbol symbol: method
setDate(int, java.util.Date) location:
interface java.sql.CallableStatement"
Here's the sample code:
Connection con = n...
I'm working on a List implementation. Because of this, I'll have to override the methods
Collection.containsAll(Collection<?> c);
Collection.removeAll(Collection<?> c);
Collection.retainAll(Collection<?> c);
But as it's explained by Sun, they accept collections with any kind of content (note the <?>). So the collection is not checked ...
The implementing-result-paging-in-hibernate-getting-total-number-of-rows question trigger another question for me, about some implementation concern:
Now you know you have to reuse part of the HQL query to do the count, how to reuse efficiently?
The differences between the two HQL queries are:
the selection is count(?), instead of th...
Hi ,
i am no RegEx expert.
I need to extract a certain number out of an HTML table.
An example:
<td>13</td><td>
</td><td align="right">29.543</td>
<td align="right">1.777</td>
<td align="right">2.588</td>
</tr><tr><td><a href="player.php?p=84668" >Caterdamus</a></td>
<td>7</td><td>
Meister</td><td align="right">9.874</td>
...
I want to create a table where I can click the numbers (1.1, 1.2 etc) under the display tab so that another window will pop up showing the cell details. How should I go about this? I found an example of a table, but it isn't clickable and there are column names whereas mine doesn't have column names. Should I follow this example or is th...
Why is it said that Annotations complement javadoc tags?
...
Are these two statement equivalent?
Thread.sleep(0);
Thread.yield();
...
Is there any way that I can get the output of jstat (in particular the -gcutil output) into ksysguard so that I can keep track of how a collection of java processes are doing from a garbage collection perspective?
I know that jconsole has similar visualisations but I would prefer it if I could get the data into ksysguard
...
Why does the compiler give an error message when you reduce the visibility of a method while overriding it in the subclass?
...
I was thinking whether it could be possible to track cursor movement through eye.
Depending on which part of screen , the eye looks the curson will move.
Can this be achieved?
Thansks everyone for replying!.I am just looking for some new idea that can be implemented and which have not been implemented.Any ideas/suggetions are welcomed.
...
Hi all,
I have an application which is extendable through java classes that conform to a given interface.
If I run the program from the command line classes, I am able to instantiate the add-on classes using:
Class.forName("myAddon").newInstance();
However if I jar the application (setting the main class correctly), I get a class not...
I am working on a servlet (runs on tomcat) which receives requests that contains Java Script code, and using the java scripting API framework evaluates/run the code and returns the answer to the user.
Since we are dealing with user generated code, the code can be a good code and it can be bad code. As an example for a bad code can be wh...
I want to write a program which can control my cursor movements depending on the the way I move my finger on the touchpad. I want my program to get the location where the user touched the touchpad, then I want to control mouse movement using my own program. I want do this in Java. Can I do this in Java? I would like to run it on Windo...
hi can any one please help me on how to convert from 10/21/2009 to Wed Oct 21 18:48:12 UTC+0530 2009 in my java class
...
i have a string value that i have to insert in mysql database. and i have to escape some literal like (' , " ,% ,) in this string so how can i use regex for that
...
I am creating a GUI program and I need a table with different sized columns. How do I change it so that the 1st column is smaller than the 2nd and 3rd column?
...
My app is a JApplet which opens a JFrame. the applet has a listener and a button, so that if the frame goes behind another window (looses focus), the user can simply click the button to get it to come to the front. frame.toFront(); This works fine.
But initially (in the applet's public void init() {}),
after calling frame.setVisible(tr...