java

Stuck in a loop ! :o

Hi. I'm trying to implement my own List system in Java. the List class file : package RoutingDemo.List; /** * A 2-way Linked-List to store generic elements. * */ public class List { /* Instance Variables --------------------------------------------------------------------------- */ /** * Reference to el...

What's wrong with JSplitPanel (or JTabbedPane)?

I have two panels that i wish to display to the user. I decided to add them to a JTabbedPane. I also want to allow the user to have a side by side view of them both at the same time. So I added the two panels to my JTabbedPane and then i created a JSplitPanel as such : tabs.addTab("Align Image Points", imageControlPanel); tabs.a...

Passing PHP output stream to Java

I am building an app using SOAP/web services to interact with a Java API. All was going swimmingly until now. I need to pass an output stream as a param to a Java method from PHP. I am pretty sure I need to use PHP output buffering and fwrite, I am just not sure how to go about it. I know you can use Java in php by using $myJavaFromPHP...

Maven Modules + Building a Single Specific Module

I have a multi-module Maven project with a parent project P and three sub-modules A, B, and C. Both B and C are war projects and both depend on A. I can type "mvn compile" in P and have all of the sub-modules properly compiled. The problem comes when I want to do operations for specific modules. I'd like to be able to package a war f...

JScrollPane problem

The JScrollpane is not visible at the JTextArea... Can anybody find out what is wrong in my code? And how to fix it? import java.awt.*; import java.awt.event.*; import javax.swing.*; import java.util.*; import java.text.DateFormat; class PrimaryInterface extends JFrame implements ActionListener { ImageIcon iimages; ...

Transform a triangle to another triangle

Hi i am trying to create the affine transform that will allow me to transform a triangle into another one. What i have are the coordinates for the 2 triangles. Can you help me? Following the answer by Adam Rosenfield i came up with this code in case anyone is bored to solve the equation himself : public static AffineTransform createTra...

Android Screen Timeout

Hello all. I know its possible to use a wakelock to hold the screen, cpu, ect on but how can I programmatically change the "Screen Timeout" setting on an Android phone. ...

JPQL and timestamp with timezone

I have the following field definitions in one of my JPA entities: @Column(nullable = false, name = "start_time", columnDefinition= "TIMESTAMP WITH TIME ZONE") @Temporal(javax.persistence.TemporalType.TIMESTAMP) private Date startTime = new Date(); @Column(nullable = true, name = "end_time", columnDefinition= "TIMESTAMP WITH TIME ZONE")...

How do I copy .app bundles with Ant on Mac OS X?

Hey guys, I just had a quick question about copying files on Mac os x with ant. I've written myself a great little build script for my iPhone development. The script copies the compiled .app files that are created from xcodebuild. Anyway, the ant command does not seem to work. It does not copy the .app file correctly. it copies the cont...

how to make this a generic method in java?

public void setSRC(int var) { if (src== null) { src = new int[1]; src[0] = var; } else { int i = 0; int[] temp = null; temp = new int[src.length]; temp = src; i = temp.length; src = new int[i+1]; for (int j =0; j < temp.length ; j++) ...

Tomcat configuration for servlets

Hi, I´ve installed Tomcat and I've been testing it: I wrote some .html and .jsp files and tried then in the server. They semm to work correctly together. For example: these files I'm trying allow me to upload a file to the server and writes its name in a database (mysql). Once this is done I have a button that allows me to upload another...

How do I determine if I'm going to get an inline or redirecting java install?

I'm using the following Java Deployment Toolkit: http://java.sun.com/javase/6/docs/technotes/guides/jweb/deployment_advice.html#deplToolkit Now, I've searched the docs, and I cannot find when the inline java installer is possible. If the user has absolutely no java installed, they will be redirected to the get java page. If java has be...

Convert a single hex character to its byte value in java

I have a single hexadecimal character, say char c = 'A'; What's the proper way of converting that to its integer value int value =??; assert(a == 10); Doesn't matter really for now if a is an int or a byte. ...

Using generics for arrays

Is it possible to use generics for arrays? ...

Java GUI Design Advice

I'm programming my very first GUI app in Java using the Swing framework. I've coded a basic login system using the JTextField, JPasswordField, and JButton classes. Now, I'm writing the actionPerformed method for the button, which I want to remove these items as they are no longer necessary, but I am unsure as to the best way of achieving...

I need to know the Big O time of my binary heap code and how can I make it better

public static void CreateMaxHeap(int[] a) { for (int heapsize = 0; heapsize < a.Length; heapsize++) { int n, p; n = heapsize; while (n > 0) { p = (n - 1) / 2; if(a[n]>a[p]) Swap(a,n,p); n = p; } } } // end of create heap ...

Recommended frameworks for Enterprise Service Bus (ESB) in open source projects

With an abundance of frameworks for Java Enterprise Service Bus(OpenESB, ServiceMix, Apache Synapse, ...), which one should be selected for new projects? What are the pros and cons for each one? How well have they worked for you? ...

Using Yahoo Fire Eagle on Grails / Java

Hi everyone! Has anyone implemented the Yahoo Fire Eagle API in a Java / Grails application? How did you do it? I want to poll their REST web service with my Grails application. Yahoo offers some API Kits for various programming languages such as PHP, Ruby, etc. Unfortunately, there is nothing similar available for Java / Groovy (there...

Can I supress the loading dialogs in Java Web Start?

I'm trying to put together a Java Webstart app, but don't want it to display the Webstart splash screen, or "downloading app" boxes. Is there any way I can turn them off? (I'm fine with it displaying the Permissions Request box, but nothing else). ...

how to generate a self signed and configure an SSL?

I am very new to SSL,wants to install SSL for my application on GLASSFISH,though tried to find some tutorials which can teach me from basic,but was unable to find any elaborative solution . 1)Like how to generate a self signed Certificate for the SSL? 2)How to configure this certificate with my application? 3)how to Configure only LOGIN ...