java

How to deploy Java Communications API

I've been developing a java application with the eclipse RCP which requires the Java Communications API. Now as the javax.comm has to be setup first (install javax.comm.properties, win32comm.dll and comm.jar) my question ist: How should I deploy my application to make sure javax.comm will be setup on the user's machine? Should I provide ...

Accessing private variables in Java via reflection

I'm trying to write a method that will get a private field in a class using reflection. Here's my class (simplified for this example): public class SomeClass { private int myField; public SomeClass() { myField = 42; } public static Object getInstanceField(Object instance, String fieldName) throws Throwable {...

Is List<List<String>> an instance of Collection<Collection<T>>?

I wrote this handy, generic function for converting a collection of collections into a single set: public static <T> Set<T> makeSet(Collection<Collection<T>> a_collection) { Iterator<Collection<T>> it = a_collection.iterator(); Set<T> result = new HashSet<T>(); while (it.hasNext()) { result.addAll(it.next()); } return result; } ...

Erlang and Java interfacing

I am particularly interested in knowing the performance implications of the Erlang component when doing this kind of interfacing. After learning about Erlang I thought that it might be useful to code certain components of an application in Erlang where I need to use the high concurrency and throughput that it provides. Has any one tried...

What is XML BOM and how do I detect it?

What exactly is the BOM in a ANSI XML document and should it be removed? Should a XML document be in UTF-8 instead? Can anyone tell me a Java method that will detect the BOM? The BOM consists of the characters EF BB BF . ...

Suggest me a book with java programming problems

Please suggest me a Java book that contains challenging programming problems. ...

Converting a 64-bit long UTC timestamp into Actionscript Date

I'm using a Java 64-bit long representation of UTC time System.currentTimeInMillis() and sending that to an Actionscript client as a String, and I want to convert to an Actionscript UTC Date. The trouble is Actionscript (and other ECMAScript like Javascript) only use a 64-bit Floating point number representation, so precision is lost w...

Changing Font Size and leaving space between button in a JOptionPane

The text in my JOptionPanes are way to small I was wondering how I could change the font of the text inside the pane. Also, I would like to be set a space between two buttons. Something like |Canecl| |DoneSave| |Save| ...

UnsatisfiedLinkError When Loading a Library from Java in MATLAB

I've been integrating simple java modules into the MATLAB environment on Windows with some success. Recently I encountered a problem with a third-party library which attempts to load a dll. The java ClassLoader throws the UnsatisfiedLinkError when the load is attempted: java.lang.UnsatisfiedLinkError: no <libname> in java.library.path ...

Java bounded wilcard type

Hi, I need to define a generic class, and the type parameter must be an enum. I think it should look something like public class <T> MyClass<T extends Enum<T>> { } But I can't seem to figure out the exact syntax. I should mention that I need a way to refer to the type (within MyClass) that it is instantiated with. Thanks! ...

Getting SSID and other information of a wireless network in Java

I'm trying to get the SSID of my wireless network device in Java. I tried the official network tutorials http://java.sun.com/docs/books/tutorial/networking/nifs/retrieving.html but getDisplayName() getName() don't return SSID. Is there a way to get an exact SSID? Also, I'm also trying to read the wifi signal strength of all my network de...

Where & How to start a career as a software developer

Hi All, I am a newbie here. So please bear with me if this is a duplicate/very trivial Qn. I am not from a Computer Science background. But currently working in software testing. I would like move to software development. I know there is whole interesting areas outside there. But I am facing difficulty in choosing where to start? I have...

Java loading library windows 7 64bit

I have a java webstart program, it runs on xp, osx, vista, and windows 7. I just tried to run it on windows 7 64bit and it is having a problem loading a library. On this win7x64 machine I have the 64bit jdk/jre and the library it is not loading is swt-win32.dll. Yeah it's 32bit, but I'm getting: Exception in thread "Thread-10" java.lang...

How do you add a border to a row in a Jtable?

I have a Jtable and I want to highlight a row by adding a border to the row. I have extended a DefaultTableCellRenderer and I figure the work needs to be done in the getTableCellRendererComponent method. I'm guessing that since there doesn't seem to be a concept of a row that I need to create a custom border for the individual cells in ...

Struts Tiles 1 - nested tiles problem

I am using Struts tiles 1 succesfully, however I have come across a problem when trying to nest tiles. I currently have a layout like so: I wish to have another template like this, for use in quite a few user pages: So I wish to extend the first layout for the user layout. In the tiles definiton I am using: <definition name=".bas...

Disabling the close x in a JOptionPane

I would like to disable the close x in the upper left corner of my JOptionPane how would I do this? ...

What is equivalent to FuseKit or Tweenlite (for Flash) in Java?

I've seen another post on stackoverflow but was not really satisfied with the responses. I'm use to tweening using code in Flash. See FuseKit and Tweenlite. Are there java equivalents? This processing library is the closest that I've found. ...

How to store rmi connections in java?

I'm with a problem here. I have a client A code that calls a B via RMI. After that I'm sending a queue request via JMS to the real implementation C. However, I don't know the "address" of A. Is there a way to store the connection data somehow so that I can return the data to A later? Basically the thing is that B can have tons of reques...

Java Graphics Font - How to make sure the characters lie in particular area?

I have an Image. On the bottom portion of the image, I would like to create a colored strip say, of height 100. I am already done with creating the strip and I can basically write strings in that portion (e.g. copyright of the image etc). The following is my method. public static BufferedImage captionMyImage(BufferedImage sourceImage) {...

many-to-many JPA mapping inserting but not fething the child collections

Hello good people! i've hit a block once again with hibernate.I've posted numerous times on different aspects of the user and contact management that i've been building. The sad thing is that i didn't really have the time to play with it and understand it better before actually starting working with it. Sorry but English is not my ...