java

java

  • All Sites

1 answer

understanding hashmap java syntax myMap.get().put()

I was going through the following tutorials and I came across this code which I got stumped as to what it is doing: while (true) { if (myMap != null && myMap.get() != null) { ...

26 secs ago
4 answers

Test all values in a boolean[]

I'm wondering if there is a more 'neat' way to test if all the values in a boolean array are true/false than iterating through the array and testing each individually like this: for (boolean ...

36 secs ago
1 answer

Display the whole image using DrawImage() after Image rotation

I am rotating and scaling the image using AffineTransform. When I display the image using Graphics2D.drawImage() the whole image does not get displayed so I am calling the AffineTransform.translate …

0 answers

Ebean Database Locked

I'm using the version of the Ebean ORM implemented in Bukkit (so it may be an older version). I have a problem by updating "Rows". The following Exception Appears: Java.lang.PersistenceException: ...

1 min ago
0 answers

Issue with using JSTL tag library with Tomcat server

This might sound like a strange problem but I'm not being able to use the jstl tag library in my J2EE application running on Tomcat server. This same web application is running perfectly fine on ...

3 mins ago
2 answers

Java PrintWriter - Save File to Source Package in NetBenas

I am using the following java code in NetBeans to read and write to a file. import java.io.*; import java.util.*; public class FileReadWrite { StringTokenizer tokenizer; BufferedReader ...

0 answers

how to use opengl to draw 3D skymap?

I can use Conlines.csv to draw 2D starmap. but now I want to draw 3D starmap. How can I do? Q1:How to use MicroSoft HomePlanet3.3's Conlines.csv to draw 3D starmap. Q2:How to add star touch event?

6 mins ago
1 answer

Swingworker Freezing Dialogs, not updating

I hope I'm asking the right questions here but feel free to ask me for any additonal information. I am trying to write a program in Java that will process a chunk of code from a textarea. the program …

0 answers

writing data from json to java object using jackson

I have been using jackson library to read data from input stream to java object. the code is as follows: json is string in which data is in the form of JSON ObjectMapper mapper = new ...

7 mins ago
6 answers

reading the form data in servlet. data posted with post method and servlet called with ?q=test1

Hey I am trying to read the form data in a servlet sent with post method. And the servlet is called as OnlineExam?q=saveQuestion. Now the servlet is working as: public class OnlineExam extends ...

7 mins ago
2 answers

Problem with mongo-java-driver on MacOSX

I can't connect to MongoDB from Groovy script. Env: trnls-mbpro:test trnl$ sw_vers ProductName: Mac OS X ProductVersion: 10.6.5 BuildVersion: 10H574 trnls-mbpro:test trnl$ java -version java …

8 mins ago
3 answers

Elliptic Curve Cryptography algorithms in Java

We're a pair of amateurs in cryptography. We have to implement different algorithms related to elliptic curve cryptography in Java. So far, we have been able to identify some key algorithms like ...

3 answers

How do I send csv/text file from an Android phone to a wifi printer?

I am developing an Android application were I am supposed to get the data from a database in csv/txt file format and later I have to send the files to a wifi printer. Do anyone know how I might get …

8 mins ago
1 answer

Using @ManyToOne and @OneToMany causes org.hibernate.exception.GenericJDBCException

I'm learning Hibernate with annotations and I got a weird exception while trying to use @OneToMany and @ManyToOne , the code is below : Employee.java @Entity @Table(name = "EMPLOYEE") public ...

6 answers

Copy entire directory contents to another directory?

Method to copy entire directory contents to another directory in java or groovy?.

9 mins ago
3 answers

How to run Java .class file from another .class file? (java newb)

I've been running different individual Java .java files in the Netbeans IDE by right-clicking the .java files themselves in the Project Explorer of Netbeans (the portion normally at the upper left ...

2 answers

Java - How to replace “ ” “ with ”"

So i want to replace all " from a file my java code is reading with nothing. Just so the all the " get removed and i can write the information i want. For example the file contains: <span ...

10 mins ago
3 answers

Comparing Scala and Java Double.NaN

Why does this comparison evaluate to true? scala> Double.NaN equals java.lang.Double.NaN res5: Boolean = true But this one evaluates to false? scala> Double.NaN == java.lang.Double.NaN res6: …

11 mins ago
1 answer

Referenced Javadoc not showing in Eclipse

I am developping a library for Android applications in Eclipse and I have added some Javadoc to the classes and methods that are visible to my users. I've generated the javadoc with Project->Generate …

12 mins ago
2 answers

Replacing chained method call using method reference

"Java 8 Lambdas: Pragmatic Functional Programming" has an example for using peek method in Stream API. This piece of code prints artist nationalities whose name starts with "The": ...

12 mins ago
0 answers

Best way to comment regex

Regular expressions are one of the worst aspects of debugging hell. Since they are contained in string literals, It's hard to comment how they work when the expressions are fairly long. Say I have …

13 mins ago
2 answers

Tomcat websocket echo app

I am fairly new to websockets and am pulling my hair out. I am using the echo app as a template. I have created a project in eclipse called echo and have placed the source for EchoAnnotation.java and …

15 mins ago
1 answer

Is it safe to use localstorage to store session variables and user password?

I'm trying to make a web application in Java with a login/session system using com.sun.net.httpserver and as far I know, it does not have an inbuilt method to this. So, I had the following idea: 1 - …

15 mins ago
0 answers

Juniper network connect on Ubuntu 14.04 cannot find 32 bit Java

I have Ubuntu x64 and trying to install Juniper network connect. Installed 64bit jre/jdk, icedtea and 32bit jre sudo apt-get install openjdk-7-jre icedtea-7-plugin sudo apt-get install ...

1 answer

Exception in thread “main” java.sql.SQLException: near “s”: syntax error

I wrote a program that populates a database with a list of words. Problem is, it throws up the "Exception in thread "main" java.sql.SQLException: near "s": syntax error" every time I try to run the …

17 mins ago
0 answers

netBeans GUI form change panel

I'm using the GUI form designer from netBeans for the first time and I just can't change the content of my JFrame. What I want is to include an other JPanel when I get into a menu of my menu bar, so …

2 answers

Selection sort strings from string object array without importing anything other than Scanner (code provided)?

public static String sorting(){ for (int i = 0; i < pigArray.length; i++){ for (int k = i + 1; k <pigArray.length; k++){ ...

20 mins ago
1 answer

Why isn't my GWT web application running properly?

I'm going through the book: GWT in Action. On chapter I'm working through the very first hello world application. It's all in development mode. My issue is that the label in my .java file is not ...

21 mins ago
2 answers

error in class extending AsyncTask

I have been trying to get some data from my dotnet webservice and pass the results in json format to my android application. The json data is retrieved in doInBackground fucntion (which is being ...

3 answers

Java to JavaScript Compiler

Besides GWT out there, are there other Java to JavaScript Compiler. Currently all my work is done in Java and I heard of Java2Script too. Anyone out there knows other Java to JavaScript?

21 mins ago
15 30 50 per page
1 2 3