java

Can't send many SMS using a loop

I want to send SMS from my PC using a GSM modem. I have used this example and I can send SMS. I want to use a loop to SMS to many users, but it doesn't work. My error: sms.SerialConnectionException: Port currently owned by SMSConnector at sms.SerialConnection.openConnection(SerialConnection.java:93) at sms.Sender.send(Sender.ja...

Java int division confusing me.

I am doing very simple int division and I am getting odd results. This code prints 2 as expected: public static void main(String[] args) { int i = 200; int hundNum = i / 100; System.out.println(hundNum); } This code prints 1 as not expected: public static void main(String[] args) { int i = 0200; int hundNum = i /...

How to run a java file/project in remote JVM which is present in other Network ?

I am trying to work on a project which involves running/executing the java file in three JVM on different Network. If i locally run the Java file should simultaneously should run in all three or two JVM. For example :/usr/local/helloWorld.java class HelloWorld { public static void main(String args[]){ System.out.print...

Detect design time in NetBeans

When using the Swing graphical editor in NetBeans is it possible for a custom component to detect that it's design time? E.g. public CustomComponent() { initComponents(); if (!isDesignTime()) { someIcon = IconFactory.loadIcon("icons/SomeIcon.png"); } } Basically I'm after something like .net's Component.DesignMode...

Java: Dynamically Load Multiple Versions of Same Class

I've looked all around and I haven't been able to figure out how to accomplish this. What I'd like to be able to do is to load set of classes, probably all in the same folder. All of which implement the same interface and are the same class, then in my code I'd like to be able to call functions on those classes. Any help you can give, ...

Where is a list of available intents in Android?

Hi all, I'm starting to learn how to develop apps for Android, and I'm having some issues with intents--it just doesn't seem like they're documented at all. All I want to do is send the user to the video recorder, where they record a video, and the video information is returned to my app. I know this is possible, as I've seen it in othe...

How to not write the DocumentRoot to the XML

Hi, I'm using EMF, and I created my ecore from XSD. I notice that the XML that are being saved by the editor have the element DocumentRoot, which is not part of my original XSD. Can I somehow not generate it, so it will not be in the XML files of the editor? Ido ...

Hibernate Search or Compass

I can't seem to find any recent talk on the choice. Back in '06 there was criticism on Hibernate Search as being incomplete and not being ready to compete with Compass, is it now? Has anyone used both and have some perspective on making the decision. I am developing a web app in Java in my free time, its just me so I'm looking to cut co...

How to extract all the zipped subdirectories and file using java program

Hi, I have a a zipped file. That file contains various directories and files also. I want to extract all those and save in a specified path. So How to write a java program to extract the zipped file. Thanks Sunil Kumar Sahoo ...

Getting Permissions error while using stream.publish method of facebook API

Hi I want to publsh a post on user's wall but am getting this "permission error" error code 200 when trying to use stream.publish method of facebook api...i hve requested for extended permissions as: http://m.facebook.com/login.php?api%5Fkey="+API_KEY&....&req_perms=read_stream,publish_stream,offline_access but when i make call...

How to dynamically remove legend in charts using Jasper reports?

How to dynamically remove the legend from a chart using the Jasper report API? I have a chart to display dynamically based on some configurations, which includes the legend as a option, so if legend is unchecked I need to hide or remove the legend form the chart. Is there any function available in the API which can do that? ...

JDBC Connection and Statement Classes

Since Connection and Statements are interfaces, interface methods will be abstract by default. How can we create Connection and Statement interfaces in our Java program while connecting to the database? ...

Writing Ajax code in JAVA

I want to write ajax code in java i.e. i want use the functionality of ajax without using ajax. I'm looking for some API of JAVA which can do so. Like we post data of a web page through JAVA program similarly I want to perform operation of ajax through JAVA program. Please suggest. ...

java applet parameter overwriting

I have developed a map applet that has JLabels on it. The JLabels get their X/Y coordinate values from an applet parameter file in order to be shown on the map in an exact position. The problem is: The map applet normally runs on a big LCD screen but some clients want to view the map in their browsers too. The issue with this is that th...

Playframework and Django

I have worked with Django before and have recently seen the Play framework. Is this the Java community's answer to Django? Any experiences with it? Any performance comparisons with other Java web frameworks? Edit:Almost similar to http://stackoverflow.com/questions/1597086/any-experience-with-play-java-web-development-framework, the re...

What's the best pattern to handle a table row datastructure?

The Facts I have the following datastructure consisting of a table and a list of attributes (simplified): class Table { List<Attribute> m_attributes; } abstract class Attribute {} class LongAttribute extends Attribute {} class StringAttribute extends Attribute {} class DateAttribute extends Attribute {} ... Now I want to do dif...

Get the array of strings by matching the pattern in the given string

I have a pattern @@{} and given a string I need to find out all the strings coming in between the curly braces. Example : If my string is Hi This is @@{first} and second is @@{second} along with third @@{third} string The output I expect is a string array consisting of elements: first second third My Java code for this goes...

Overview / Tutorial on moving from dl.util.concurrent to java.util.concurrent

We have been using Doug Lea's concurrent library for more than 8 years now. For backwards compatibility reasons our code was restricted to use Java 2 language level and JDK 1.3 library. Now we are working on a major new release and are finally able to use Java 5 features. We think we should move from using the "old" concurrency library...

How to map E.164 Telephone Number to DNS name using ENUM protocol in java?

Hi I am currently working on a java application to map the E.164 Telephone Number to DNS name to get a IP address.I dont know how to do this.If any body knows it please help me. ...

simple program using jacob and excel

i want to learn jacob for doing tasks with excel. looking for any simple code using jacob and excel which runs without errors. i tried running the code in jacob help but i'm getting errors. to understand the basics i need a simple code. Can you provide me this sample code .thanks ...