java

Program to change the phone numbers a call is redirected to if a mobile phone cannot be reached?

Is it possible to write a program that will change the phone numbers a mobile phone redirects calls to if it cannot be reached by the network? ...

Override java.awt.Button

Hi, I am trying to override default java Button behavior and trying to add additional label to a button. I am new to java GUI and thought that overriding paint method will solve my problem, but when I do that and draw additional label in Button paint method it looks fine, but my label disappears if I click on that button in my applicati...

jbutton.doClick() clicks the buttons but does not perform the function

I have a jbutton which performs a function when clicked on by mouse. For doing this programatically I have this other function void clickButton(){ backButton.doClick(); } When I run the clickButton() function I can see the backButton being pressed on the jFrame but the function associated with backButton does not happen. When I...

Reading a Java BLOB object stored a database using .NET

Hi All, I have an xml file which is stored in an "image" column in an MSSQL database. This field is being set by a java program i do not have access to. I have been told its just a standard Java "blob" object. Is there anyway for me to read this field from the db in .NET and decode it into a readable string? I have close to no Java k...

Java += Means What?

In Java what does += do or mean? for example: devtop += Math.pow(x[i] - mean, 2); ...

Is it possible to detect if a class is available in Java?

I would like to be able to do something like (psuedo-code): if (classAvailable) { // do a thing } else { // do a different thing } What would be even better is if I could extend a class from ClassA if it's available or ClassB, if it isn't. I suspect this isn't possible though. ...

Java interface "Alias"

Consider the following two Java files that contain a simplified version of my issue #a.java package a; public interface I { //... } #b.java package b; public interface I { //... (different stuff from a.I) } You'll notice within my project there are two interfaces named "I". This cannot be changed. I am in a situation where I need t...

How to create a horizontal slider

How would I create a horizontal slider which will slide from left to right automatically after each 1 second. ...

create exe using launc4j java

Hi,i have created exe by luunch4j and build.xml ant file in java but when i click exe i'm get could not find main class program will exit kind of message,even i click on jar file it also giving message as failed to load main class manifest attribute,what is the problem? Thanks in adavance rajani ...

Image icon in expandable list view in android

Hi, I want to add an image icon in expandable list view .I have seen the tutorial they have added only in child elements .Is there any other way to add image icon in parent Any help would be appreciated. Thanks in advance. ...

How is an instance initializer different from a constructor?

In other words, why would you need an instance initializer? What difference or advantage do you have in writing a instance initializer over a constructor? ...

Renaming packages in Eclipse

In Eclipse's "Package Explorer", let's say I have a list of packages like this: com.dog com.cat com.frog If I want to rename the "com" part of the package structure to be "animal", then I could select each package (above) and perform a refactor > rename. If I have many packages that start with "com", that process may take a while. ...

Help trying to use Apple Push Notification Service through Java

Am trying to implement a Java program which sends an Apple Push Notification to an iPhone client app... Found the following library: Java APNs Provider code: Created the following code (from Javapns) to use in my app: try { PayLoad payLoad = new PayLoad(); payLoad.addAlert("My alert message"); payLoad.addBadge(45); pa...

Packaging Code + property file

I have packages.. a, b and c in my java application. I have a resources folder set for my application and it contains packages x, y, z. I need to package files in a,b and property file in x as a jar. I am using net beans 6.5. How do I achieve this! ...

SAX parser in java

can SAX parser handle self closing tag? or will it cause an error? eg <br/> or <hr/> ...

Displaying huge arraylist in jsp

Hi All, I have 15000 records in an arraylist each record size is around 2MB. I have display this list on a jsp page in the most efficient manner. Please suggest the best method to do it. I can not filter data on server side. User needs all records on jsp page at once. Thanks in advance. ...

JFrame Menu get hidden

When adding my canvas in JFrame Menu, why my menu always hide behind my canvas? canvas = new MyCanvas(); canvas.setBackground(Color.lightGray); contain.add(canvas, BorderLayout.CENTER); ...

Commons Digester add Singleton Object

Hi I Have a XML and I am using commons-digester1.8 to create a object of my bean. My bean contains a reference to another Bean which is singleton. Is there any way I can create/get the reference of singleton object and get my bean populated. My xml contains <>/language tag and for this tag bean has Language.class reference. Language.cl...

Selector.close throwing a java.util.ConcurrentModificationException on AIX platforms

Hi, I am using java nio selector, and seem to hit the following issue randomly but consistantly in my application while calling the selector.close. The selector object is being accessed by a single thread in my application. The same application works fine on Solaris, Linux and Windows. I feel that this is an issue is with the AIX...

Hibernate session and garbage collector

An object with hibernate session data member when garbage collected, is session's jdbc connection closed? In other words is leaving closing session to garbage collector bad idea? ...