java

unable to send email on google app engine

Hi Gurus, I have tired to use Javamail to send email. But I got the following message javax.mail.SendFailedException: Send failure (javax.mail.MessagingException: Illegal Arguments (java.lang.IllegalArgumentException: Bad Request: )) I have tried to send email from the admin (account I upload the app) or the user I login the app as. ...

Java Convert Object[] Array to Vector

What's the best way to convert an Object array to a Vector? JDE < 1.5 public Vector getListElements() { Vector myVector = this.elements; return myVector; } this.elements is an Object[] Thanks, rAyt I should clarify my question My target platform is a blackberry. Collections aren't supported. Array.asList() isn't, either :/ F...

Determine file being used by FileHandler

I am creating a java.util.logging.FileHandler that is allowed to cycle through files. When multiple instances of my application are run, a new log file is created for each instance of the application. I need to know what file is being used by the application because I want to upload the log file to my servers for further review. How can ...

How to make a Costum JasperViewer Frame ?

hi all , I am using JasperReports in my java application.But i could not remove Toolbar default jasperviewer Frame.Is there another solution for showing my myreport.jasper file ? Or can i make another Costum JasperViewer? thanx for ur helps. ...

Number guessing game - how to?

how do i make this so once the user inputs a number and presses enter(or something) it runs the if else statements! please help! public static void main(String[] args) { System.out.println("please guess the number between 1 and 100."); boolean run = true; int y = 0; Random ran = new Random(); int x = ran.nextInt(99); while (ru...

How can i Get file path in some java package ?

Hi , i am new at java so maybe this will be a silly question. I got a file in my jasper.deneme package. I wanna give a full path for it.As ya see in picture i write it like string fullpath = "/jasper.deneme/reportDeneme.jasper"; but it does not workin :) so how can i get this file's path? ...

Can I edit an excel file from a browser using POI?

Can I edit an excel file from a browser using POI? Something like google docs maybe? But in java? I've used POI for display only, way way back, but I dont remember it being editable from the browser. Any suggestions of the best approach to this? The excel will display a list/table with data, and each row will either be reported as havin...

Is it hard to convert a web app built with Jsp, Servlets & mySQL to one with Spring & Hibernate?

I'm currently working on building a java web app. I've been looking to use Spring and Hibernate so I get some proper exposure to them, but I'm just getting burned out reading and learning about them. If I go ahead and build it with JSP and Servlets on a MySQL back end, what kind of levels of code reuse would I be looking at? I imagine th...

html form submission in python and php is simple, can a novice do it in java?

I've made two versions of a script that submits a (https) web page form and collects the results. One version uses Snoopy.class in php, and the other uses urllib and urllib2 in python. Now I would like to make a java version. Snoopy makes the php version exceedingly easy to write, and it runs fine on my own (OS X) machine. But it alloca...

What will happen if records are deleted during the data retrieving process?

Let's say I have 6 records, and I set the fetch size as 2. [Id] [Name] 11 A <-- 1st fetch, start from 1 position 21 B 31 C <-- 2nd fetch, start from 3 position 41 D 51 E <-- 3rd fetch, start from 5 position 61 F If 1st user issues a "SELECT * from tablex", and 2nd user issue a "DELETE FROM tablex WHERE Id = 2. ...

When porting Java code to ObjC, how best to represent checked exceptions?

I am working on porting a Java codebase to Cocoa/Objective-C for use on desktop Mac OS X. The Java code has lots and lots of methods with checked exceptions like: double asNumber() throws FooException { ... } What's the best way to represent these in Objective-C? Exceptions or error out-parameters? - (CGFloat)asNumber { ... ...

deleting embeddable object from collection struts java

Hello, I am having issues deleting value-type embeddable objects from a collection in struts2. <display:table name="parent.collection" requestURI=""> <display:column property="entry" /> <display:column property="date" sortable="true" defaultorder="ascending"/> <display:column> </display:table> i am using the above di...

JAVA_HOME directory

Is there any linux command I could use to find out JAVA_HOME directory? I've tried print out the environment variables ("env") but i cant find the directory. ...

C# equivalent of Java PushbackReader's unread()

I'm looking for a C# equivalent to the Java's unread() method. The C# equivalent to PushbackReader is supposedly System.IO.StreamReader, but StreamReader doesnt have an "unread()" equivalent. It has Peek(), but no way to put a character back onto the stream. Java Code: // putBackChar puts the character back onto the stream // adjusts ...

How to sort a LinkedHashMap by its value class's field?

I use the following lines to sort a LinkedHashMap, but not all items are sorted, anything wrong ? LinkedHashMap<String,PatternData> statisticsMap; // fill in the map ... LinkedHashMap<String,PatternData> sortedStatisticsMap=new LinkedHashMap<String,PatternData>(); // Sort it by patternData's average ArrayList<PatternData> statis...

How to load a set of objects when Hibernate Lazy Fetchtype is used?

I have a Hibernate domain class (let's say PetOwner) with a one to many relationship with another class(Pets) [PetOwner (1)---------(*) Pet] Due to a drastic change required to improve the performance I had to change the fetchtype of the getPets() method in PetOwner class to be lazy. So the current mapping looks as follows @OneToMan...

Remove rows from JTable

I want to remove some rows from a JTable. Please help me. ...

SWT & JFace from command line

I 'm running bash shell in OS X and would like to try some SWT/JFace tutorials. I've downloaded eclipse (let's assume at $ECLIPSE_HOME) and swt.jar (let's assume at $SWT_HOME). Now, i would like to compile and run a SWT and/or JFace application from command line without running eclipse. I haven't set up CLASSPATH and i have both JDK 1.5 ...

How to use fonts in opengl in java?

The title pretty much sums it up - its the easiest thing in the world in C++ and Windows, but Java seems to struggle with this issue. I would like to stay away from solutions involving loading bitmaps of fonts, and instead try go for a native truetype font loader, if possible. Kerning and antialiasing is quite important in my applicatio...

What is the best book for java based software engineering?

Is there any book that covers and explains the following things well altogether? Software Engineering with Java in general, the concept and what to notice ... etc life cycle with java commonly practiced developing methods Best Coding Convention Version Control (and tools) Builds (and tools) tests (I think it's Junit here) Code Review (...