I wrote a Java program to mimic the sounds to dial phone numbers, it works fine except when it comes to phone cards, it needs to dial a local number first (no problem, it successfully connects to a local number), then it needs to enter the card number, problem is the other end won't accept the generated sounds for the card numbers, it on...
Is there a reliable, cross-platform way to do IPC (between two JVMs running on the same host) in Java (J2SE) that doesn't rely on the network stack?
To be more specific, I have a server application that I'd like to provide a small "monitoring" GUI app for. The monitor app would simply talk to the server process and display simple status...
hi
when i am loading some data into my java program, i usually use FileInputStream. however i deploy the program as a jar file and webstart, so i have to use getRessource() or getRessourceAsStream() to load the data directly from the jar file.
now it is quite annoying to always switch this code between development and deployment?
is t...
My current code looks like this:
final String[] value = new String[1];
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
value[0] = textArea.getText();
}
});
The use of a final array seems like a bit of a hack. Is there a more elegant solution?
I've done a lot of searching, but I don't seem to be able...
Consider the following sample code which uses a TrustManager to log whether an outgoing connection used a valid certificate (but accept the connection in all cases):
import java.security.*;
import java.security.cert.*;
import javax.net.ssl.*;
public class CertChecker implements X509TrustManager {
private final X509TrustManager def...
UPDATE: Hi Pascal, Thanks for the quick reply, This is almost what I wanted. The newlink is different for each tag, can you please help me to do that.
Thanks Micheal
All i need to do is iterate over all the link tags that appear in the input String, grab their value, and replace with a different link with out disturbing the link text
...
As I was typing some constants in Java I noticed I had used 4 keywords in a row, which Eclipse highlighted for me: public static final int. I then took a break from my regular coding and asked myself (and google with no relevant results) what the longest chain of keywords I can use and still have valid code. After a while, the best I cou...
My itch to see the Emacs syntax highlighting handle generics more effectively is getting worse and worse with each new release of the Java language. I suspect adding customization support for the language level is a significant piece of programming effort. But it would still be interesting to hear someone knowledgeable expound at a fai...
Hello. I am developing a plugin for eclipse. In this plugin I need to be able to add an item to the context menu in the text editor. So far I have been unsuccessful in this, does anyone know how to add this item.
Also, how do I get a string with the text currently selected in the editor.
Thank you so much.
...
Is there any EASY way to sort an array in descending order like how they have a sort in ascending order in the Arrays class http://www.j2ee.me/javase/6/docs/api/java/util/Arrays.html
?
Or do I have to stop being lazy and do this myself :[
...
I have a project for school and I have to use Java. Recently I found play framework and I want to try to use it. It's easy enough for a quick start, but I ran into a problem with session.
Being stateless by its nature, play sends entire session to user in cookie and receives it on next request, so it allows only limited amount of data i...
I am allowing users on my web app to schedule events based on time zones of their choice.
I want to present a good list of time zones to the end user and then convert it easily to java.util.TimeZone object at the server end.
String[] TimeZone.getAvailableIds() is something I could use, but the issue is that it prints about 585 time zo...
How can I access the messages from a resource bundle in Spring MVC inside a class that extends from AbstractController?
I have tried getMessageSourceAccessor().getMessage("a.message");
but it it throws this Exception:
org.springframework.web.util.NestedServletException:
Request processing failed; nested
exception is
org.spring...
Hi, ive been set an assignment for my java programming course and ive reached a point where i really cant work out the next step. Im wondering if anyone can help me with this code please. The assignment is as follows:
A file exists which contains the total rainfall for each month in a year, one double value on each line. Write a program...
import java.lang.Math;
public class NewtonIteration {
public static void main(String[] args) {
System.out.print(rootNofX(2,9));
}
// computes x^n
public static double power(double x, int n) {
if (n==0) {
return 1;
}
double Ergebnis = 1;
for (int i=0; i<=Math.abs(n)-1; i++) {
Ergebn...
Hi,
I am trying to create new Event objects to be persisted in the database via Hibernate. The below code successfully creates one event, but when session.save(evt) is called, I get a return value of 0 (which I think is the equivalent of null). Can anyone identify what the issue is below? If you need more information in regards to class...
This seems to be a popular complaint on many programmer forums so I wouldn't be surprised if this question was already on here. Sorry if it has already been answered but I've searched and couldn't find one that relates to Java/OO.
I have a somewhat complicated application that was written a number of months ago. It works well, but is sl...
I have a Java program that auto dials phone numbers, it can generate sounds to mimic phone keypads, works fine for normal calls, but I encountered a problem when it comes to calling card, it requires me to enter a card number, the sounds generated by my program were not accepted by the other end, it always said the card number is incorre...
The outcome of this code should be "huugiin zardal: 3", but it doesn't work.
Please help. And also is there any easy way to write it?
class Cost3{
int a;
int u;
int x;
Cost3(int a,int u,int x){
}
}
class FC1 extends Cost3{
FC1(int a1, int u1, int x1){
super(a1,u1,x1);
a=a1;
u=u1;
x=x1;
}
public int huugiin_...
Hi,
I am running into issues with passing parameters to managed beans in JSP within Oracle ADF. Here is an example JSP test page I am trying to pass parameters to a test method in a POJO:
<?xml version='1.0' encoding='windows-1252'?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
xmlns:f="http://java.sun.com...