java

Binding enum values to RadioButton in Java

I am stuck in binding values from enum to RadioButton. Lets say I have a bean: public class ValueObject { public enum ValueEnum { FIRST_VALUE, SECOND_VALUE } protected ValueEnum value; } I want to create Swing RadioButtons where user can select one from these two enum values. As I use Netbeans as IDE I would also like t...

Who will take the roll of service method in filters in java?

Hi Filters are like servlets but managed by the web container but there is service() method in servlets but there is no method called service in filters. There are three only three methods init(), doFilter(), and destroy().Can anybody elaborate on this ? ...

Ignoring your own UDP broadcasts in Java

In my program I'm sending out UDP broadcasts and reacting to them. I need a way to ignore the UDP broadcasts that I send out, but react to ones that aren't from my machine. I did try using: if (NetworkInterface.getByInetAddress(packet.getAddress()) != null) but this generated IOExceptions in some cases (java.net.SocketException: no netw...

Configure two version of same jar in single application

My application uses Http client2.0.2 jar file and my unit test suit uses Http client3.1 jar file. How do I configure two version of same jar file in single application? ...

Java JCR how to change order of nodes?

Hi, I am using Jackrabbit with JCR, how can I change the order of the nodes? ...

Jasper report can't find package net.sf.jasperreports.engine

I have a j2ee application using spring framework. I am trying to export jasper reports to xml, pdf and xhtml files. I am using eclipse ide with plugin for weblogic server and for apache tomcat server. It works fine when I run it on server(in eclipse) and choosing Tomcat as server. But when I try to run it on server(in eclipse) now choosi...

JavaPOS Devices / Credit Card

JavaPOS Devices seems a little "out of date". Are the newest devices also supported by JavaPOS? Also I'm unsure about credit card terminals. Are those supported by JavaPOS? ...

Detecting struckout text in a cell using JExcelApi

I need to detect whether the text within a cell is struck out or not. I'm using this: Cell cc = sheet.getCell("B1"); CellFormat format = cc.getCellFormat(); System.out.println(format.getFont().isStruckout()); but I remember I read somewhere that CellFormat is deprecated and CellFeatures should be used instead. How could one find out w...

SerialPortEventListener Implementation

I am playing with the Firmata protocol which allows you to control Arduino through a serial protocol. I am reading sensor values using SerialPortEventListener listening for DATA_AVAILABLE event. But i notice a lot of latency it takes a second for the updated sensor values to be registered by my application, protocol runs at a baud rate o...

converting a raw file into xml file

Hello guyz, I'm working on a project under which i have to take a raw file from the server and convert it into XML file. is there any tool available in java which can help me to accomplish this task like JAXP can be used to parse the XML document ??? Thanks in Advance.... ...

java.nio.channels.*

What is up with nio channels ? There were some nice talks when it was added to java but I still don't see people using it in their applications. Is there something wrong with it, or am I just not encountering people who use it? Any nice examples as to why I should bother using it at all ? Thanks ...

How to check if my transactional methods really support transactions?

I'm using Spring 3.0, and I have a set of methods like this: @Transactional (value = "authTransactionManager") public void remove(User user) { ... } I use 2 different transaction managers and specify necessary manager (authTransactionManager in example above). I was curious what would happen if I specify nonexistent manager. I ...

Maven, JAVA_HOME w/ OS X

Trying to get Maven, Java, and OS X to play nice together - something I've done multiple times without issue on Linux and Windows machines. I assumed all I needed to do was download Maven, setup my environment variables and I'd be good. So here's a snippet from my .bash_profile... export JAVA_HOME=/Library/Java/Home/ export M2_HOME=/u...

Equivalent of .NET's System.Xml.XmlWriter - in Java?

I want something proven and tested (e.g. apache commons level of maturity) not some code snippet from the first search result in Google Or is GenerationJava not the abandonware it seems to be (the download link and the referal to the new host - osjava.org are both 404) ...

Executing a Number of Classes Java

Hi Currently I have a folder with 6 classes. The main class being called "Interaction". I compile all the classes by using javac *.java How do I run the program? When I type "java Interaction" I get errors as the other classes are not being loaded. Its as if I need to link the other 4 classes into the main class. How do I do this? Im...

how to remove i/o exception from given code

import java.io.*; import java.awt.*; import java.awt.event.*; import java.applet.Applet; import java.awt.Graphics; import java.awt.Color; public class MyGraphic5 extends java.applet.Applet implements ActionListener { boolean go =false; int x, oldx, y, oldy; double angle; Button drawButto...

On zoom event for google maps on android

Hi We're building an application which is using the google maps api for android. I have my MapController and MapView, and I enable the built-in zoom controls using: mapView.setBuiltInZoomControls(true); I would now like to get an event when the user actually zooms on the map, how do I go about that? I can find no such event or any g...

Class inheritance problem in Java, constructors with and without params

Hi guys, I'm learning Java (2nd year IT student) and I'm having a little problem. With inheritance to be precise. Here's the code: class Bazowa { public Bazowa(int i) { System.out.println("konstruktor bazowy 1"); } public Bazowa(int j, int k) { System.out.println("konstruktor bazowy 2...

String Compare Library

Hi, I am looking for a Java 5 lbrary which let me compare some text as following lines returns true: " foo bar " == "foo bar" "foo\nbar" == "foo bar" "foo\tbar" == "foo bar" "féé bar" == "fee bar" and so on... Any suggestions? ...

Maven is failing to download the tomcat-maven-plugin snapshot

Even after wiping out my settings.xml, I still get this error when trying to use this snapshot dependency. Given the dependency: <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>tomcat-maven-plugin</artifactId> <version>1.0-SNAPSHOT</version> <configuration> <path>/licensin...